我正在尝试运行Apache和Nginx在一起。 我希望apache应该监听端口8080,nginx应该监听80.为此,我已经将ports.conf修改为监听8080,并修改了虚拟主机configuration。 重新启动后,服务器启动没有任何错误,但我无法访问该url。
在/ etc / apache2的/网站-avaialbled / mysite的
<VirtualHost *:8080> ServerName myproject ServerAdmin [email protected] DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /trac> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/error.log LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On <Location /svn> DAV svn SVNParentPath /svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/svnauth Require valid-user AuthzSVNAccessFile /etc/svnaccess </Location> <Location /trac> SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /trac PythonOption TracUriRoot /trac AuthType Basic AuthName "Trac" AuthUserFile /etc/svnauth Require valid-user </Location> </VirtualHost>
/etc/apache2/ports.conf
NameVirtualHost *:8080 Listen 8080 <IfModule mod_ssl.c> # If you add NameVirtualHost *:443 here, you will also have to change # the VirtualHost statement in /etc/apache2/sites-available/default-ssl # to <VirtualHost *:443> # Server Name Indication for SSL named virtual hosts is currently not # supported by MSIE on Windows XP. Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule>
我需要在这里改变别的东西吗?
validation在任何地方都没有其他Listen指令: grep -ri listen /etc/apache/*
同时显示netstat表示apache正在监听: netstat -plnt | grep http netstat -plnt | grep http
将httpdreplace为系统上的apache二进制文件的名称
你尝试访问后面的端口的url? …. com:8080?
我的猜测是,你打算configurationnginx作为混合代理运行,但是你不代理你想要端口8080的stream量。
你可以请张贴你的nginxconfiguration吗?
确保nginx不在443上监听。或者从apacheconfiguration中删除Listen 443 。