Ask A Question
You’re not receiving notifications from this thread.
Issue with multiple URL's on an Ubuntu/Apache2/Passenger machine
I have a linux machine that I put together within my organization for Rails applications. I have my first site all set up and working. I am now trying to add a second site/URL to the box and for some reason both URL's hit the first site that I put up. Here is my apache2 site.conf file:
Listen 80 Listen 8080 <VirtualHost *:80> PassengerRuby /home/user/.rbenv/shims/ruby ServerName mysite.com ServerAlias site1.com ServerAdmin firstname.lastname@example.org RailsEnv production DocumentRoot /home/user/rails/site1/public/ ErrorLog /home/user/rails/site1/log/error.log CustomLog /homeuser/rails/site1/log/access.log combined <Directory "/home/user/rails/site1/public/"> Options FollowSymLinks Require ip 126.96.36.199/16 Options -MultiViews </Directory> <LocationMatch "/home/user/rails/site1/public"> order deny,allow deny from all allow from 188.8.131.52/16 </LocationMatch> <VirtualHost *:8080> PassengerRuby /home/user/.rbenv/shims/ruby ServerName mysite2.com ServerAlias site2.com ServerAdmin email@example.com RailsEnv production DocumentRoot /home/user/rails/site2/public/ ErrorLog /home/user/rails/site2/log/error.log CustomLog /home/user/rails/site2/log/access.log combined <Directory "/home/user/rails/site2/public/"> Options FollowSymLinks Require ip 184.108.40.206/16 Options -MultiViews </Directory> <LocationMatch "/home/user/rails/site2/public"> order deny,allow deny from all allow from 220.127.116.11/16 </LocationMatch>
This is my hosts file:
127.0.1 Localhost 127.0.1.1:80 site1.com 127.0.2.1:8080 site2.com
Both URLs display the content for site1.com
What am I missing here?
I ended up figuring it out. I had a typo in my 000-default.conf file that was causing the issue.