Apache setup 000-default.conf file - apache

I am sure this is a simple one:
I have vagranted up a machine and setup the LAMP, and the IP is configured to 10.0.0.10.
In my Windows machine, I have modified the hosts file and added one entry named as "rsywx_remote". The ping from my Windows machine to my vagrant machine is OK. Load the "rsywx_remote" in browser from my Windows machine is also fine. The connectivity is of no problem.
I then SSH to my vagrant machine and modified the /etc/apache2/sites-enabled/000-default.conf like this:
<VirtualHost 127.0.0.1>
DocumentRoot "/www/rsywx/web"
ServerName rsywx_remote
ServerAlias rsywx_remote
<Directory "/www/rsywx/web">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
Allow from 127.0.0.1
Deny from all
Require all granted
</Directory>
</VirtualHost>
Restarted my vagrant Apache service, and it still points to the default page, not the one I expected.
Any hints?

Try:
<VirtualHost *:80>
That will listen on all addresses

Related

xampp: after virtual host configuration, why redirecting to IIS home

i am using XAMPP to create php projects on a port 8088 which is running fine. but when i configured to use Virtual Host instead of localhost:8088 now it is redirecting me to IIS home page, i tried another ports but the behavior is same. Virtual Host entry in httpd.conf is unremarked and my file entry in: httpd-vhosts.conf is as below:
<VirtualHost *:8088>
ServerName taskapp.localhost
DocumentRoot "D:\xampp\htdocs\taskapp\public"
<Directory "D:\xampp\htdocs\taskapp\public">
Require all granted
AllowOverride All
</Directory>
</VirtualHost>
any idea, what can be the issue? how to resolve it?

This site can’t be reached - XAMPP ignores custom domain vhosts

Environment
XAMPP 7.2.4 installed on Windows 10
Apache running on ports 80 and 443
Configuration
C:\Windows\System32\drivers\etc\hosts:
127.0.0.1 www.test.local test.local
C:\xampp\apache\conf\httpd.conf:
DocumentRoot "D:/htdocs"
<Directory "D:/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
C:\xampp\apache\conf\extra\httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot D:/htdocs
ServerName localhost
<Directory "D:/htdocs">
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:/htdocs
ServerName test.local
<Directory "D:/htdocs">
Allow from all
</Directory>
</VirtualHost>
The problem
When I start Apache and I access to localhost is all right. The problem comes when I try to reach test.local: the browser returns a This site can’t be reached message. It's like XAMPP ignores the custom domain vhosts defined into httpd-vhost.conf file. The same message is displayed with the server off.
This site can’t be reached
The webpage at http://test.local/ might be temporarily down or it may have moved permanently to a new web address.
ERR_ADDRESS_INVALID
A few days ago the setup was working and the only changes that I made was the new software installation. I mean, no changes in Apache config files.
If all your stack were working correctly before, don't be like me and don't forget to check if some browser extension is blocking your local traffic, like some extension related with an antivirus system.
In my case it was the Kaspersky Protection extension. When something goes wrong, it shows the following graphic.
C:\Windows\System32\drivers\etc
127.0.0.1 test.local
C:\xampp\apache\conf\extra\httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "C:/wamp64/www/test"
ServerName test.local
<Directory "C:/wamp64/www/hydroboost/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Have you updated your C:\Windows\System32\drivers\etc\hosts file with a mapping like this this?
add this line to the end of the hosts file
127.0.0.1 test.local
the localhost domain works without this mapping, because the OS already recognizes "localhost" as a built in alias for the loopback IP address
(this suggestion is assuming that you are running and testing on the same local machine)

Why do my development websites in /var/www not load?

I configured an apache2 server on a virtualbox with ubuntu. This always worked but since yesterday my websites suddenly won't load annymore. I think it has something to do with our new network router but I'm not sure since it worked the first weeks. I have configured these things :
000-default.conf
<VirtualHost *:80>
ServerName hello.int
ServerAdmin email#hotmail.com
DocumentRoot /var/www/hello.int/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
/etc/apache2/apache.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
hosts file in windows
127.0.0.1 localhost
10.0.2.15 hello.int
shared map settings and network settings virtual box
what I see when I surf to localhost:8080
when I surf to hello.int (in windows host sytem)
ERR_CONNECTION_TIMED_OUT
when I surf to 127.0.0.1 (in windows host system)
ERR_CONNECTION_REFUSED
when I ping to 127.0.0.1 (in windows host system)

Create a Virtual Host in Xamp Windows 10

Last night I have updated my windows 7 to windows 10.
The result is struggle trying to run my local apache server in windows 10 that is running on windows 7.I have tried uninstalling and installing another versions of xampp then I came up that I have to change the apache's default port just to make it run.
I changed httpd.conf
from Listen 80 to Listen 1234
AND
ServerName localhost:80 to ServerName localhost:1234
and in xampp control panel Config->Service and Port Settings. I also change the Main Port
Now I can access phpmyadmin using localhost:1234/phpmyadmin.
And now my problem is creating Virtual host
so I added in my host(C:\Windows\System32\drivers\etc\hosts) file
127.0.0.1 sample.local
127.0.0.1 anothersample.local
And my vhost (D:\xampp\apache\conf\extra\httpd-vhosts.conf) file
<VirtualHost *:1234>
DocumentRoot "D:/xampp/htdocs/sample"
ServerName sample.local
</VirtualHost>
<VirtualHost *:1234>
DocumentRoot "D:/xampp/htdocs/anothersample"
ServerName anothersample.local
</VirtualHost>
I did make sure the vhost file above was include
I already restarted my apache but seems like my vhost is not working .Can anyone point out what i missed?
Thank you #ShamSUP AND #maytham-ɯɐɥıλɐɯ I was able to solve my problem by uninstalling the xampp.
Then following the instructions here
I will just list the steps I have done here.
Windows+R and type appwiz.cpl and use Turn Windows features on or off and install the IIS Manager Console by expanding
Internet Information Services->Web Management Tools->then checking IIS Management Console
Windows+R and type InetMgr.exe and enter, then expand Site Right Click it then click Edit Bindings
Change the http port from 80 to 8080
After that I then install the XAMPP and configure the Virtual host
host(C:\Windows\System32\drivers\etc\hosts) file
127.0.0.1 sample.local
127.0.0.1 anothersample.local
vhost (D:\xampp\apache\conf\extra\httpd-vhosts.conf) file
<VirtualHost *:80>
DocumentRoot "D:\xampp\htdocs\sample"
ServerName sample.local
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/anothersample"
ServerName anothersample.local
</VirtualHost>
And by default in windows virtual host is uncommented
After restarting apache and mysql.The Virtual host is running now.I hope this may help someone in the future.
E:\xampp\apache\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "E:/xampp/htdocs/dev2017/schools"
ServerName dev.schools
<Directory "E:/xampp/htdocs/dev2017/schools">
</Directory>
</VirtualHost>
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 dev.schools
NOTE: Restart Xampp Server.
Type URL: http://dev.schools
Maybe my issue is different.
Above answer not worked for me Windows 10, XAMPP portable 5.6.30
My XAMPP works on port 80 but when I set virtual host then its localhost also go to virtual host folder. So http://localhost also shows the content of http://mydrupal
I simply added this to /apache/conf/extra/httpd-vhosts.conf file as well.
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs"
ServerName localhost
<Directory D:/xampp/htdocs>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Above code was not required on Windows 7.
For virtual host - mydrupal
<VirtualHost *:80>
DocumentRoot "D:/vhosts/drupal"
ServerName mydrupal
<Directory D:/vhosts>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Hope this helps.

Apache 2 Test Page

I dont know why I see this Apache test page when I've configured my virtual host to point to my project?
Server settings
<VirtualHost *:80>
ServerName malltomobiledev.com
DocumentRoot /home/dcms/public/html/dcms/app/web
<Directory "/home/dcms/public/html/dcms/app/web">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Apache restarted fine, so it was access the folders fine.
My host file
Ip malltomobiledev.com
Any ideas guys?
If you're using apache 2.2, make sure you have NameVirtualHost *:80 set in your main apache config file, otherwise apache will use the default virtual host, which points to the test page.
You can check the configured virtual hosts using apachectl -S