0
votes

I was trying to create a virtual host on my localhost, I followed a tuto on the internet. Here're the steps :

1) I created my project on desktop (using laravel 5)

2) I opend the file "httpd-vhosts.conf" (C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\httpserver\apache2418x161221110224\conf\httpd-vhosts.conf ) to uncomment this line : "Include conf/extra/httpd-vhosts.conf"

3) I edited the file "httpd-vhosts.conf" I added the following lines :

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:\Users\Sony\Desktop\links"
ServerName links.localhost
</VirtualHost>

4) I edited the file "hosts" (C:\Windows\System32\drivers\etc\hosts) and added this line "127.0.0.1 links.localhost"

5) Then I restarted easyphp and executed the following command on my command line : ipconfig /flushdns

--> Results : The file "httpd-vhosts.conf" is empty

This line is commented again : "Include conf/extra/httpd-vhosts.conf"

When I try to access the vhost "http://links.localhost", is just like if i am accessing the localhost

This is what I have at the end of "httpd.conf"

# VIRTUAL HOSTS
## Virtualhost localweb
<VirtualHost 127.0.0.1>
DocumentRoot "C:/Program Files (x86)/EasyPHP-Devserver-16.1/eds-www"
ServerName 127.0.0.1
<Directory "C:/Program Files (x86)/EasyPHP-Devserver-16.1/eds-www">
    Options FollowSymLinks Indexes
    AllowOverride All
    Order deny,allow
    Allow from 127.0.0.1
    Deny from all
    Require all granted
</Directory>
</VirtualHost>
#Costumized vhost config file
Include conf/links-vhost.conf
1
You edited a easyphp config file, restartet easyphp and the edited config file is now empty. Is this correct? Maybe you should not edit the config file directly but instead put the vhost configuration into another file. Maybe this post can help: stackoverflow.com/questions/36025245/…Seb
The file "httpd-vhosts.conf" is empty what did you mean? if the file is emtpy then you didnt save the config ... it is just a text-file ... btw. it is no good idea to use USERS Directory as DocumentRoot ..donald123
Thank you for your answers, the post you provided was helpful, but still it doesn't work. At the end of my httpd.conf I added : Include conf/extra/links-whost.conf And put my virtual hosts in this file. I also changed <VirtualHost *:80> to <VirtualHost 127.0.0.1> Now, I am getting this : site is inaccessibleNaj

1 Answers

0
votes

First create a file (say) name it links.conf and add your Virtual host

<VirtualHost *:80>
DocumentRoot "C:\Users\Sony\Desktop\links"
ServerName links.localhost
</VirtualHost>

Now at the the end of your httpd.conf add : Include conf/links.conf.