PHP websocket on SSL with proxy_wsTunnel - Apache - php

I have a php websocket server running but I want to connect to it via https. This is my JS: var conn = new WebSocket('wss://81.169.228.159:3671/wss2');
And this is my apache config:
ProxyPass /wss2/ ws://domain:3671/
I have proxy and proxy_wstunnel enabled.
So, what am I doing wrong?
ERROR LOG:
[Mon Mar 13 04:38:04.228450 2017] [mpm_prefork:notice] [pid 6683] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 04:38:04.228471 2017] [core:notice] [pid 6683] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 12:42:39.475641 2017] [:error] [pid 12432] [client 195.169.9.201:8546] script '/var/www/html/luukwuijster.io/phpinfo.php' not found or unable to stat
[Mon Mar 13 12:56:25.370986 2017] [mpm_prefork:notice] [pid 6683] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 12:56:26.539948 2017] [mpm_prefork:notice] [pid 26932] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 12:56:26.539972 2017] [core:notice] [pid 26932] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:06:36.280229 2017] [mpm_prefork:notice] [pid 26932] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:06:37.473220 2017] [mpm_prefork:notice] [pid 27256] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:06:37.473248 2017] [core:notice] [pid 27256] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:19:52.144983 2017] [mpm_prefork:notice] [pid 27256] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:19:53.235045 2017] [mpm_prefork:notice] [pid 27775] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:19:53.235083 2017] [core:notice] [pid 27775] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:22:21.467607 2017] [mpm_prefork:notice] [pid 27775] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:22:22.618416 2017] [mpm_prefork:notice] [pid 27911] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:22:22.618455 2017] [core:notice] [pid 27911] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:28:08.356148 2017] [mpm_prefork:notice] [pid 27911] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:28:09.546926 2017] [mpm_prefork:notice] [pid 28540] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:28:09.546964 2017] [core:notice] [pid 28540] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:35:26.856446 2017] [mpm_prefork:notice] [pid 28540] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:35:28.532498 2017] [mpm_prefork:notice] [pid 29153] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:35:28.532541 2017] [core:notice] [pid 29153] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:46:19.084561 2017] [ssl:error] [pid 29170] [client 208.93.152.93:54712] AH02042: rejecting client initiated renegotiation
[Mon Mar 13 13:57:14.410892 2017] [mpm_prefork:notice] [pid 29153] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:57:16.465381 2017] [mpm_prefork:notice] [pid 29927] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:57:16.465424 2017] [core:notice] [pid 29927] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 14:00:03.312882 2017] [:error] [pid 29936] [client 81.169.228.159:33706] PHP Notice: Undefined index: text in /var/www/html/luukwuijster.io/slack/cronofy/huiswerk.php on line 9

I assume that you have a React\Socket\Server listening on port 8080 (aka php push-server.php). The tutorial on the ratchet website should get you up to this point.
I also assume that you have already configured and loaded the proxy and proxy_wstunnel apache modules as mentioned in the question.
Below is the config I personally use to achieve a WebSocket connection.
I use /ws/ instead of the /wss2/ mentioned in the tutorial for a better looking URL. Feel free to adjust the config as necessary.
Apache Config
#SSL (Secure)
<VirtualHost *:443>
DocumentRoot /FILE_PATH_TO_WEBROOT
ServerName local.sitename.com
ServerAlias local.sitename.com
<Directory /FILE_PATH_TO_WEBROOT>
Options FollowSymLinks
AllowOverride all
php_flag display_errors On
Require all granted
</Directory>
SSLCertificateFile /etc/httpd/ssl/.crt
SSLCertificateKeyFile /etc/httpd/ssl/.key
ProxyRequests Off
ProxyPass "/ws/" "ws://local.sitename.com:8080/"
</VirtualHost>
#NON-SSL (Insecure)
<VirtualHost *:80>
DocumentRoot /FILE_PATH_TO_WEBROOT
ServerName local.sitename.com
ServerAlias local.sitename.com
<Directory /FILE_PATH_TO_WEBROOT>
Options FollowSymLinks
AllowOverride all
php_flag display_errors On
Require all granted
</Directory>
ProxyRequests Off
ProxyPass "/ws/" "ws://local.sitename.com:8080/"
</VirtualHost>
Secure JavaScript Socket Connection
var conn = new WebSocket('wss://local.sitename.com/ws/');
Insecure JavaScript Socket Connection
var conn = new WebSocket('ws://local.sitename.com/ws/');

Related

Localhost doesnt show my files in /var/www/html

When i try to get into my localhost folder I get this
I tried to uninstall and reinstall apache2 but nothing changed
i restarted apache2 and reloaded it nothing
i can access php myadmin and also mysql
however localhost stays 'empty' but i have folders in var/www/html
http://local.server.ip gives me this error
bash: http://local.server.ip: No such file or directory
[Fri Nov 22 00:07:53.655847 2019] [mpm_prefork:notice] [pid 21559] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 00:07:53.655912 2019] [core:notice] [pid 21559] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:15:05.406145 2019] [mpm_prefork:notice] [pid 21559] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Nov 22 01:15:05.436629 2019] [mpm_prefork:notice] [pid 21559] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:15:05.436640 2019] [core:notice] [pid 21559] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:16:52.092655 2019] [mpm_prefork:notice] [pid 21559] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Nov 22 01:16:52.129474 2019] [mpm_prefork:notice] [pid 21559] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:16:52.129490 2019] [core:notice] [pid 21559] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:30:50.708402 2019] [mpm_prefork:notice] [pid 21559] AH00169: caught SIGTERM, shutting down
[Fri Nov 22 01:31:02.848171 2019] [mpm_prefork:notice] [pid 27340] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:31:02.848207 2019] [core:notice] [pid 27340] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:31:20.409265 2019] [mpm_prefork:notice] [pid 27340] AH00169: caught SIGTERM, shutting down
[Fri Nov 22 01:34:21.641232 2019] [mpm_prefork:notice] [pid 28568] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:34:21.641268 2019] [core:notice] [pid 28568] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:34:46.704722 2019] [mpm_prefork:notice] [pid 28568] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Nov 22 01:34:46.725762 2019] [mpm_prefork:notice] [pid 28568] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:34:46.725772 2019] [core:notice] [pid 28568] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 02:08:30.892405 2019] [mpm_prefork:notice] [pid 28568] AH00169: caught SIGTERM, shutting down
[Fri Nov 22 02:08:30.984621 2019] [mpm_prefork:notice] [pid 30975] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 02:08:30.984671 2019] [core:notice] [pid 30975] AH00094: Command line: '/usr/sbin/apache2'
grep -inRH "ServerName " /etc/apache2/ | grep "\s#"*
I added
ServerName = Localhost
and
grep -inRH "ServerName " /etc/apache2/ | grep "\s#"*
gives me this output
i used a virtuell host before
You need to put a file, not just folders in /var/www/html. Make sure the file is readable by the Apache process too. Try putting a file named index.html there, run chmod a+r /var/www/html/index.html and then browse to localhost again - you should see the contents of your file then

page isn't working after installing ioncube

I've downloaded a wordpress template and it needs to have Ioncube installed, I did as what digital ocean said on my vps and the right version for my php7.0 is installed (as I can see the result in phpinfo(); )but now when I go to my wordpress template page and it gives me the error
This page isn’t working
yourhost.com is currently unable to handle this request.
HTTP ERROR 500
this is my log
[Thu Nov 09 06:25:02.686651 2017] [mpm_prefork:notice] [pid 9032] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Nov 09 06:25:02.686691 2017] [core:notice] [pid 9032] AH00094: Command line: '/usr/sbin/apache2'
Failed loading /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: cannot open shared object file: No such file or directory
Failed loading /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: cannot open shared object file: No such file or directory
Failed loading /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: cannot open shared object file: No such file or directory
Failed loading /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: cannot open shared object file: No such file or directory
Failed loading /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: cannot open shared object file: No such file or directory
[Thu Nov 09 06:25:50.830177 2017] [mpm_prefork:notice] [pid 9032] AH00169: caught SIGTERM, shutting down
Failed loading /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: /usr/lib/php/20151012/ioncube_loader_lin_7.0.so: cannot open shared object file: No such file or directory
[Thu Nov 09 06:25:51.971658 2017] [mpm_prefork:notice] [pid 11316] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Nov 09 06:25:51.971857 2017] [core:notice] [pid 11316] AH00094: Command line: '/usr/sbin/apache2'
[Thu Nov 09 06:29:29.356068 2017] [mpm_prefork:notice] [pid 11316] AH00169: caught SIGTERM, shutting down
[Thu Nov 09 06:29:30.508534 2017] [mpm_prefork:notice] [pid 31764] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Nov 09 06:29:30.508625 2017] [core:notice] [pid 31764] AH00094: Command line: '/usr/sbin/apache2'
[Thu Nov 09 06:53:32.691037 2017] [mpm_prefork:notice] [pid 31764] AH00169: caught SIGTERM, shutting down
[Thu Nov 09 06:53:33.737673 2017] [mpm_prefork:notice] [pid 3759] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Nov 09 06:53:33.737757 2017] [core:notice] [pid 3759] AH00094: Command line: '/usr/sbin/apache2'
[Thu Nov 09 06:56:32.551814 2017] [mpm_prefork:notice] [pid 3759] AH00169: caught SIGTERM, shutting down
[Thu Nov 09 06:56:32.752382 2017] [mpm_prefork:notice] [pid 14853] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Nov 09 06:56:32.752490 2017] [core:notice] [pid 14853] AH00094: Command line: '/usr/sbin/apache2'
[Thu Nov 09 07:01:24.790695 2017] [mpm_prefork:notice] [pid 14853] AH00169: caught SIGTERM, shutting down
[Thu Nov 09 07:01:25.989824 2017] [mpm_prefork:notice] [pid 18452] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Nov 09 07:01:25.989955 2017] [core:notice] [pid 18452] AH00094: Command line: '/usr/sbin/apache2'
[Thu Nov 09 07:01:31.080510 2017] [:error] [pid 18456] [client 5.232.32.241:24228] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:01:33.950712 2017] [:error] [pid 18455] [client 5.232.32.241:45501] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:01:36.156017 2017] [:error] [pid 18457] [client 5.232.32.241:35511] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:02:49.758464 2017] [:error] [pid 18479] [client 5.232.32.241:19653] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:09:30.678341 2017] [:error] [pid 18457] [client 5.232.32.241:46475] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:09:36.741121 2017] [:error] [pid 18459] [client 5.232.32.241:13475] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:09:59.726341 2017] [:error] [pid 18456] [client 5.232.32.241:18124] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:10:01.693749 2017] [:error] [pid 18480] [client 5.232.32.241:14882] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:10:09.060585 2017] [:error] [pid 18455] [client 5.232.32.241:16883] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:10:09.893809 2017] [:error] [pid 18458] [client 5.232.32.241:57989] PHP Fatal error: The file /var/www/html/wordpress/30693_Avada-7/avada522/wp-content/themes/$
[Thu Nov 09 07:14:15.677688 2017] [mpm_prefork:notice] [pid 18452] AH00169: caught SIGTERM, shutting down
[Thu Nov 09 07:14:16.566425 2017] [mpm_prefork:notice] [pid 18910] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Nov 09 07:14:16.566549 2017] [core:notice] [pid 18910] AH00094: Command line: '/usr/sbin/apache2'
[Thu Nov 09 10:24:33.989899 2017] [mpm_prefork:notice] [pid 18910] AH00169: caught SIGTERM, shutting down
[Thu Nov 09 10:24:34.142330 2017] [mpm_prefork:notice] [pid 317] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Nov 09 10:24:34.142433 2017] [core:notice] [pid 317] AH00094: Command line: '/usr/sbin/apache2'
please help me solve it
I figured it out, although it says you need an ioncube_7, but I should install go with php5.6

phpinfo doesnt show memcache

I have some trouble to enable memcache. I'm running Debian 9 and installed memcache. It looks like everything is working
~$ ps aux | grep memcached
memcache 2341 0.0 0.0 335696 2648 ? Ssl 18:57 0:01 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1
olafHus 7486 0.0 0.0 12788 972 pts/1 S+ 21:41 0:00 grep memcached
I've checked if the module is enabled:
~$ sudo cat /etc/php5/conf.d/20-memcached.ini
; uncomment the next line to enable the module
extension=memcached.so
Moreover, I also get
~$ sudo netstat -tap | grep memcached
tcp 0 0 localhost:11211 0.0.0.0:* LISTEN 2341/memcached
and finally I've run a /etc/init.d/apache2 restart, sudo /etc/init.d/apache2 reload and sudo /etc/init.d/memcached restart. But when I'm checking my localhost where a simple phpinfo() is located memcache is not listed. I've followed this instruction and put the following file to see if memcache is working
<?php
$mem = new Memcached();
$mem->addServer("127.0.0.1", 11211);
$result = $mem->get("blah");
if ($result) {
echo $result;
} else {
echo "No matching key found. I'll add that now!";
$mem->set("blah", "I am data! I am held in memcached!") or die("Couldn't save anything to memcached...");
}
?>
But it doesn't work. Does someone know what's going on and how I can make memcache work?
EDIT:
This is the output of the log
$ sudo cat /var/log/apache2/error.log
[Mon Jul 10 18:23:10.671404 2017] [mpm_event:notice] [pid 29979:tid 140044669715648] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:23:10.671544 2017] [core:notice] [pid 29979:tid 140044669715648] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:23:27.115014 2017] [mpm_event:notice] [pid 29979:tid 140044669715648] AH00491: caught SIGTERM, shutting down
[Mon Jul 10 18:23:27.170643 2017] [mpm_prefork:notice] [pid 4817] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:23:27.170737 2017] [core:notice] [pid 4817] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:23:27.447314 2017] [mpm_prefork:notice] [pid 4817] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:23:27.536634 2017] [mpm_prefork:notice] [pid 4873] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:23:27.536680 2017] [core:notice] [pid 4873] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:26:41.201787 2017] [mpm_prefork:notice] [pid 4873] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:26:41.292588 2017] [mpm_prefork:notice] [pid 6922] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:26:41.292635 2017] [core:notice] [pid 6922] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:27:35.149322 2017] [mpm_prefork:notice] [pid 6922] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:27:35.244846 2017] [mpm_prefork:notice] [pid 6981] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:27:35.244889 2017] [core:notice] [pid 6981] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:29:32.870011 2017] [mpm_prefork:notice] [pid 6981] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:29:32.960699 2017] [mpm_prefork:notice] [pid 26042] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:29:32.960738 2017] [core:notice] [pid 26042] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:29:54.322087 2017] [mpm_prefork:notice] [pid 26042] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:29:54.416333 2017] [mpm_prefork:notice] [pid 26089] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:29:54.416371 2017] [core:notice] [pid 26089] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:32:55.998398 2017] [mpm_prefork:notice] [pid 26089] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:32:56.092397 2017] [mpm_prefork:notice] [pid 30053] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:32:56.092431 2017] [core:notice] [pid 30053] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:37:17.489919 2017] [mpm_prefork:notice] [pid 30053] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:37:17.586762 2017] [mpm_prefork:notice] [pid 30260] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:37:17.586801 2017] [core:notice] [pid 30260] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:37:21.451096 2017] [mpm_prefork:notice] [pid 30260] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:37:24.067553 2017] [mpm_prefork:notice] [pid 30343] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:37:24.067594 2017] [core:notice] [pid 30343] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:38:51.583610 2017] [mpm_prefork:notice] [pid 30343] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:38:53.488078 2017] [mpm_prefork:notice] [pid 30595] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:38:53.488121 2017] [core:notice] [pid 30595] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:39:59.404361 2017] [:error] [pid 30597] [client 127.0.0.1:38144] PHP Fatal error: Class 'Memcached' not found in /var/www/html/cache_test.php on line 2
[Mon Jul 10 18:39:59.404388 2017] [:error] [pid 30597] [client 127.0.0.1:38144] PHP Stack trace:
[Mon Jul 10 18:39:59.404394 2017] [:error] [pid 30597] [client 127.0.0.1:38144] PHP 1. {main}() /var/www/html/cache_test.php:0
[Mon Jul 10 18:40:05.482553 2017] [:error] [pid 30598] [client 127.0.0.1:38146] PHP Fatal error: Class 'Memcached' not found in /var/www/html/cache_test.php on line 2
[Mon Jul 10 18:40:05.482595 2017] [:error] [pid 30598] [client 127.0.0.1:38146] PHP Stack trace:
[Mon Jul 10 18:40:05.482607 2017] [:error] [pid 30598] [client 127.0.0.1:38146] PHP 1. {main}() /var/www/html/cache_test.php:0
[Mon Jul 10 18:46:58.898526 2017] [mpm_prefork:notice] [pid 30595] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:46:59.004874 2017] [mpm_prefork:notice] [pid 31027] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:46:59.004915 2017] [core:notice] [pid 31027] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:51:21.595950 2017] [mpm_prefork:notice] [pid 31027] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:51:21.692445 2017] [mpm_prefork:notice] [pid 31243] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:51:21.692480 2017] [core:notice] [pid 31243] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:54:33.454240 2017] [mpm_prefork:notice] [pid 31243] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:54:33.539549 2017] [mpm_prefork:notice] [pid 2072] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:54:33.539598 2017] [core:notice] [pid 2072] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:54:41.149185 2017] [mpm_prefork:notice] [pid 2072] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:54:41.244007 2017] [mpm_prefork:notice] [pid 2115] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:54:41.244039 2017] [core:notice] [pid 2115] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:54:45.901404 2017] [mpm_prefork:notice] [pid 2115] AH00171: Graceful restart requested, doing restart
[Mon Jul 10 18:54:45.922983 2017] [mpm_prefork:notice] [pid 2115] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:54:45.922999 2017] [core:notice] [pid 2115] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 10 18:58:37.287228 2017] [mpm_prefork:notice] [pid 2115] AH00169: caught SIGTERM, shutting down
[Mon Jul 10 18:58:37.381938 2017] [mpm_prefork:notice] [pid 2524] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon Jul 10 18:58:37.381994 2017] [core:notice] [pid 2524] AH00094: Command line: '/usr/sbin/apache2'

Laragon 400 Bad Request Laravel 5.1

just now i install laragon and getting 400 bad request, i have no idea how to fix.
Laragon full 2.2.2 php-7.1.1
Access log --
127.0.0.1 - - [03/Apr/2017:15:42:44 +0300] "GET / HTTP/1.1" 400 347
127.0.0.1 - - [03/Apr/2017:15:42:44 +0300] "GET /favicon.ico HTTP/1.1" 400 347
Error log --
Apache server interrupted...
[Mon Apr 03 15:42:38.008826 2017] [mpm_winnt:notice] [pid 11704:tid 580] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Mon Apr 03 15:42:42.686208 2017] [core:warn] [pid 16048:tid 548] AH00098: pid
file C:/laragon/bin/apache/httpd-2.4.25-win32-VC14/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Apr 03 15:42:42.827314 2017] [mpm_winnt:notice] [pid 16048:tid 548] AH00455: Apache/2.4.25 (Win32) OpenSSL/1.0.2k PHP/7.1.1 configured -- resuming normal operations
[Mon Apr 03 15:42:42.827314 2017] [mpm_winnt:notice] [pid 16048:tid 548] AH00456: Apache Lounge VC14 Server built: Dec 17 2016 10:42:52
[Mon Apr 03 15:42:42.827314 2017] [core:notice] [pid 16048:tid 548] AH00094: Command line: 'C:\\laragon\\bin\\apache\\httpd-2.4.25-win32-VC14\\bin\\httpd -d C:/laragon/bin/apache/httpd-2.4.25-win32-VC14'
[Mon Apr 03 15:42:42.829314 2017] [mpm_winnt:notice] [pid 16048:tid 548] AH00418: Parent: Created child process 14292
[Mon Apr 03 15:42:44.474536 2017] [mpm_winnt:notice] [pid 14292:tid 612] AH00354: Child: Starting 64 worker threads.
Make sure your ServerName contains only alphanumerical characters.
Eg: http://dummy_domain.local produces 400 Bad Request (with Apache 2.4) while http://dummy-domain.local works as expected.

Apache 2.4.4 WAMP VHosts error

I had created two VirtualHosts earlier namely [localhost] and "phpsite". Yesterday I renamed "phpsite" as "phppages" and added one more virtual host named "techsupport.com". I use port 8088 on my Apache server. But now I am able to use [localhost]:8088 and phpsite:8088 though there's no virtual host named "phpsite" and if I go for techsupport.com:8088 I get nothing.
Here's my vhost content:
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#<VirtualHost *:80>
# ServerAdmin webmaster#dummy-host.example.com
# DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "logs/dummy-host.example.com-error.log"
# CustomLog "logs/dummy-host.example.com-access.log" common
#</VirtualHost>
#<VirtualHost *:80>
# ServerAdmin webmaster#dummy-host2.example.com
# DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
# ServerName dummy-host2.example.com
# ErrorLog "logs/dummy-host2.example.com-error.log"
# CustomLog "logs/dummy-host2.example.com-access.log" common
#</VirtualHost>
<VirtualHost *:8088>
ServerAdmin admin#example.com
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias www.localhost.com
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "c:/wamp/www">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</Directory>
</VirtualHost>
<VirtualHost *:8088>
DocumentRoot "e:/techsupport"
ServerName techsupport.com
ServerAlias www.techsupport.com
ErrorLog "logs/techsupport-error.log"
CustomLog "logs/techsupport-access.log" common
<Directory "e:/TechSupport">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</Directory>
</VirtualHost>
<VirtualHost *:8088>
DocumentRoot "e:/phppages"
ServerName phppages
ServerAlias www.phppages.com
ErrorLog "logs/phppages-error.log"
CustomLog "logs/phppages-access.log" common
<Directory "e:/PHPPages">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</Directory>
</VirtualHost>
Apache's error log shows this:
[Sun Aug 25 12:50:06.646882 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 12:50:06.646882 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 12:50:06.646882 2013] [core:notice] [pid 7936:tid 500] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 12:50:06.647883 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00418: Parent: Created child process 912
[Sun Aug 25 12:50:07.216263 2013] [mpm_winnt:notice] [pid 912:tid 384] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 12:51:15.409867 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 12:51:17.411205 2013] [mpm_winnt:notice] [pid 912:tid 384] AH00364: Child: All worker threads have exited.
[Sun Aug 25 12:51:17.433218 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00430: Parent: Child process 912 exited successfully.
[Sun Aug 25 12:51:30.206760 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 12:51:30.207763 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 12:51:30.207763 2013] [core:notice] [pid 11396:tid 204] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 12:51:30.208763 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00418: Parent: Created child process 4808
[Sun Aug 25 12:51:30.670070 2013] [mpm_winnt:notice] [pid 4808:tid 384] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 13:25:30.406049 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 13:25:32.406924 2013] [mpm_winnt:notice] [pid 4808:tid 384] AH00364: Child: All worker threads have exited.
[Sun Aug 25 13:25:32.423935 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00430: Parent: Child process 4808 exited successfully.
[Sun Aug 25 13:28:38.706114 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 13:28:38.706114 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 13:28:38.706114 2013] [core:notice] [pid 10328:tid 516] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 13:28:38.708114 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00418: Parent: Created child process 4716
[Sun Aug 25 13:28:39.170423 2013] [mpm_winnt:notice] [pid 4716:tid 380] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 13:33:14.347584 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 13:33:16.349839 2013] [mpm_winnt:notice] [pid 4716:tid 380] AH00364: Child: All worker threads have exited.
[Sun Aug 25 13:33:16.369232 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00430: Parent: Child process 4716 exited successfully.
[Sun Aug 25 13:33:18.445939 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 13:33:18.445939 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 13:33:18.445939 2013] [core:notice] [pid 7048:tid 464] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 13:33:18.446940 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00418: Parent: Created child process 2556
[Sun Aug 25 13:33:18.801179 2013] [mpm_winnt:notice] [pid 2556:tid 324] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 13:35:23.175992 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 13:35:25.178255 2013] [mpm_winnt:notice] [pid 2556:tid 324] AH00364: Child: All worker threads have exited.
[Sun Aug 25 13:35:25.197268 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00430: Parent: Child process 2556 exited successfully.
[Sun Aug 25 13:35:28.224795 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 13:35:28.224795 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 13:35:28.224795 2013] [core:notice] [pid 10616:tid 504] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 13:35:28.225792 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00418: Parent: Created child process 4012
[Sun Aug 25 13:35:28.599042 2013] [mpm_winnt:notice] [pid 4012:tid 324] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 13:43:03.326392 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 13:43:07.389104 2013] [mpm_winnt:notice] [pid 4012:tid 324] AH00364: Child: All worker threads have exited.
[Sun Aug 25 13:43:07.404736 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00430: Parent: Child process 4012 exited successfully.
[Sun Aug 25 13:45:26.908312 2013] [mpm_winnt:notice] [pid 4788:tid 504] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 13:45:26.970818 2013] [mpm_winnt:notice] [pid 4788:tid 504] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 13:45:26.970818 2013] [core:notice] [pid 4788:tid 504] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 13:45:26.970818 2013] [mpm_winnt:notice] [pid 4788:tid 504] AH00418: Parent: Created child process 5084
[Sun Aug 25 13:45:27.517719 2013] [mpm_winnt:notice] [pid 5084:tid 384] AH00354: Child: Starting 150 worker threads.
In httpd.cnf file:
Listen 0.0.0.0:8088
(Earlier it was just Listen 8088)
And
Include conf/extra/httpd-vhosts.conf
is uncommented as it should be.
I am helpless right now and have already spent 2 days on it. Please help.
Thanks
I had created two VirtualHosts earlier namely [localhost] and "phpsite". Yesterday I renamed "phpsite" as "phppages" and added one more virtual host named "techsupport.com". I use port 8088 on my Apache server. But now I am able to use [localhost]:8088 and phpsite:8088 though there's no virtual host named "phpsite" and if I go for techsupport.com:8088 I get nothing.
The only reason that "phppages" is not working and "phpsite" is working could be because you have a DNS entry or an entry in the host file for "phpsite" and not for "phppages". To debug this I would start by pinging them.
ping phppages
ping phpsite
While we're at the name resolution topic, your techsupport.com:8088 is not going to work because techsupport.com gets resolved to external site. If they don't have port 8088 open to the public, you simply won't be able to navigate to that site on that port. However, if they did then you would have been able to browse their pages not yours.
I'm not sure how WAMP manages host names, but the first thing to check is your DNS Server if you have one, otherwise check C:\Windows\System32\drivers\etc\hosts.
To make phppages work add the following lines to your C:\Windows\System32\drivers\etc\hosts:
127.0.0.1 phppages www.phppages.com
# Similarly for techsupport.com and www.techsupport.com
127.0.0.1 techsupport.com www.techsupport.com
After this your phppages and techsupport urls should work.
Caution: Adding public URLs to your hosts file might cause confusions in future when/if you removed that virtual host from httpd-vhosts.conf and forget to remove corresponding host name from the host file, in which case these public URLs will not be reachable to the correct destination. So, it is not recommended to use public host names for your virtual hosts.
Hope this helps.

Categories