Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to run apache and nginx together. I want that apache should listen to port 8080 and nginx should listen to 80. For that, I have modified the ports.conf to Listen to 8080 and also modified the virtual host configuration. After restart, the server starts without any error but I am unable to access the url.

/etc/apache2/sites-avaialbled/mysite

<VirtualHost *:8080>
  ServerName myproject
  ServerAdmin your@email.com

  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>

Do I need to change something else here?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

Verify that there are no other Listen directives anywhere: grep -ri listen /etc/apache/*

Also show what netstat says apache IS listening on: netstat -plnt | grep http

Replace httpd with the name of the apache binary on your system

share|improve this answer
    
Replacing httpd did work –  gentrobot Oct 20 '12 at 11:11
add comment

Make sure that nginx is not listening on 443. Or remove the Listen 443 from apache configuration.

share|improve this answer
add comment

Did you try to access the url with the port behind? ....com:8080 ?

My guess is that you intended to configure nginx to be running as a reverce proxy, but you do not proxy the traffic you want to port 8080.

Can you please post your nginx config, too?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.