You are not logged in.

#1 2017-03-04 20:41:51

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Help with Apache Virtual Hosts [SOLVED]

I need to setup virtual hosts in my Apache server. I followed the setup in the wiki.
My current Apache server has been working just fine for the past 4 years, so I figured it would be a walk in the park ... but things did not go as planned sad

This is what I have done, as per the wiki:
(1)
In my /etc/hosts I added the name of the new virtual host

 127.0.0.1    api.dev

(2)
In /etc/httpd/conf/httpd.conf I un-commented the line for vhosts

 Include conf/extra/httpd-vhosts.conf

(3)
In the httpd-vhosts.conf I included the file I want for the virtual-host

 Include conf/vhosts/api.dev

(4)
Finally in the api.dev file I put the following:

 <VirtualHost *:80>
    DocumentRoot "/home/ralvez/HTML/api/public"
    ServerName  "api.dev"
    ErrorLog /var/log/httpd/api-dev.error.log
    CustomLog /var/log/httpd/api-dev.access.log common

   <Directory /home/ralvez/HTML/api/public/>
     Options FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>
</VirtualHost>

NOTE: I use HTML instead of public_html in my home directory and I made that adjustment in the appropriate file.

As a final step I restarted the httpd service.

That setup worked for a few hours until I had to add another virtual server. After adding a second one when I go to http://localhost I get a black page.
I then tried http://api.dev which was working and I got the same result.  I then removed the second virtual host ... and to my surprise I got
the very same problem !!

So ... I'm not sure where I went wrong. I hope some of you guys with more experience will be able to point me in the right direction.

Thanks in advance.

R.

NOTE: A spelling error caused the problem. All is well smile

Last edited by ralvez (2017-03-05 14:47:50)

Offline

Board footer

Powered by FluxBB