I am trying to establish an Nginx + Apache-with-PHP-module configuration. It worked on Debian 6 with such configuration:
<VirtualHost 127.0.0.1:9002 >
ServerName mysite.com
AddDefaultCharset UTF-8
AssignUserID username username
CustomLog /var/www/httpd-logs/mysite.com.access.log combined
DocumentRoot /var/www/username/data/www/mysite.com
ErrorLog /var/www/httpd-logs/mysite.com.error.log
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
php_admin_value open_basedir "/var/www/username/data:."
php_admin_value upload_tmp_dir "/var/www/username/data/mod-tmp"
php_admin_value session.save_path "/var/www/username/data/mod-tmp"
</VirtualHost>
NameVirtualHost 127.0.0.1:9002
<Directory /var/www/username/data/www/mysite.com>
Options -ExecCGI -Includes
php_admin_value open_basedir "/var/www/username/data:."
php_admin_flag engine on
</Directory>
On a new server I am running Ubuntu 16. When I restart apache2 service and run netstat
there is nothing on 127.0.0.1:9002 (even though apache is running). Nginx, as expected, gives connect() failed (111: Connection refused) while connecting to upstream
error. I've tried:
- Changing the port (9002) to any other port
- Commenting out
NameVirtualHost
directive and changingVirtualHost 127.0.0.1:9002
toVirtualHost *:9002
- Disabling
firewalld
— it was disabled from the beginning - Checking if apache does load the .conf file — it does (
apache2ctl -S
)