Xampp is not recognized VirtualHost after few attempts? - php

I had installed xampp few years ago. But now I have a little problem with the configuration of the vhost.
I have 4 different pages in my server, the apache is running with the port 80. So my configuration to the vhost is as following:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/paginasweb/munkys
ServerName www.munkys.com.co
<Directory "C:/xampp/htdocs/paginasweb/munkys">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/paginasweb/flinda
ServerName www.flinda.com.co
<Directory "C:/xampp/htdocs/paginasweb/flinda">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/paginasweb/pluxpc
ServerName www.pluxpc.com.co
<Directory "C:/xampp/htdocs/paginasweb/pluxpc">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/paginasweb/conradoarte
ServerName www.conrado-arte.com.co
<Directory "C:/xampp/htdocs/paginasweb/conradoarte">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
Allow from all
</Directory>
</VirtualHost>
My problem is the following:
When I tried to join to my website, www.conradoarte.com.co, the page is loading outside the local network but after a few minutes or attempts the dns is lost, but if I join to the website inside my local network the page is up. After reload the page from my local network I can see again the page outside the local network.
I don't know what is the real problem.

Related

Unable to access my virtual host from the same network using IP address

I'm trying to run two different sources in xampp (one for admin one for users).
I have found one solution by using httpd-vhosts.conf.
In C:\xampp\apache\conf\extra\httpd-vhosts.conf file I have added below config.
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\project\user\www"
ServerName 192.169.9.99
<Directory "C:\xampp\htdocs\project\user\www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\project\admin\www"
ServerName 192.169.9.99.co
<Directory "C:\xampp\htdocs\project\admin\www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Now, I can able to see user and admin pages running in 192.169.9.99 and 192.169.9.99.co
But, here my problem is, I tried with another system that present in my same network.
It has given proper result for 192.169.9.99 but not for 192.169.9.99.co
192.169.9.99.co redirecting to 99.co website.
Where I did wrong, Is I missed anything?
There are any other solutions for achieving this requirement?
Is this possible to achieve this?Thanks.
#Start
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\project\admin\www"
ServerName 192.169.9.99.co
<Directory "C:\xampp\htdocs\auction\frontend\www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
#next
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\project\user\www"
ServerName 192.169.9.99
<Directory "C:\xampp\htdocs\auction\frontend\www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
192.169.9.99 Will be found earlier because the match.
VirtualHost *:80
192.169.9.99
192.169.9.99.co
I have added "Listen 8081" in httpd.conf, so that now my xammp will listen 80 and 8081 ports.
In httpd-vhosts.conf I have added
<VirtualHost *:8081>
DocumentRoot "C:\xampp\htdocs\project\admin\www"
</VirtualHost>
Document root for port 80 will taken from httpd.conf file.
Now I tried with another system that in my network, on 192.169.9.99 My user site is running.
In 192.169.9.99:8081 My admin site is running.

Subdomain, virtual host XAMPP

Looking for some help with setting up a subdomain in XAMPP.
I've read a few articles, whilst they seem to be all related to local installs, what I have is a PORTABLE version of XAMPP so there is no drive prefix.
I tried some of the mentioned articles below but none seem to work. They all display a server not responding or end up going to google to search.
I have in httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Then in extra/httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *>
ServerAdmin admin#localhost.com
ServerName localhost
ServerAlias localhost
DocumentRoot "/xampp/htdocs/public"
<Directory "/xampp/htdocs/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost forums*>
ServerAdmin admin#localhost.com
ServerName forums
ServerAlias forums
DocumentRoot "/xampp/htdocs/public/forums"
<Directory "/xampp/htdocs/public/forums">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
When I do this "forums.localhost" is turns into this in chrome "http://www.forums.localhost/" and then I get:
The webpage is not available
Amongst many I have read, some mention editing windows hosts file, but given this is a PORTABLE version of XAMPP I can't always go editing the hosts file in every computer.
these were few I tried but they all fail
http://austin.passy.co/2012/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/
https://community.apachefriends.org/f/viewtopic.php?p=198815&sid=7a72729a95ed298148f8635dd414295a
how to create subdomains in apache(xampp) server?
Can someone please help me how to get subdomain to work on a PORTABLE version or how I should be doing it, or is editing windows hosts file compulsory?
not tested but try this:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin admin#localhost.com
ServerName localhost
ServerAlias localhost
DocumentRoot /xampp/htdocs/public
<Directory "/xampp/htdocs/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin#localhost.com
ServerName forums
ServerAlias forums
DocumentRoot /xampp/htdocs/public/forums
<Directory "/xampp/htdocs/public/forums">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Don't forget to write
127.0.0.1 forums
to your hosts file, if you don't have a DNS-Server.
You need to add forums.localhost to your hosts file.
Edit %SystemRoot%\System32\drivers\etc\hosts and add 127.0.0.1 forums.localhost.
I don't think there is another way to do this, sorry (maybe creating a script that automatically edits the hosts file, but it's quite dirty).

Virtual host, apache2 and aws no access

Created a instance in aws with ubuntu 14:04 server, installed and configured my apache2 virtual hosts as follows:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName magento.com
ServerAlias www.magento.com
DocumentRoot /var/www/magento.com/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/magento.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<VirtualHost>
and
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName recomendador.com
ServerAlias www.recomendador.com
DocumentRoot /var/www/recomendador.com/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/recomendador.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<VirtualHost>
My files are in:
/var/www/magento.com/public_html/
/var/www/recomendador.com/public_html/
My /etc/hosts :
127.0.0.1 localhost
127.0.0.1 magento.com
127.0.0.1 recomendador.com
When I access my aws:
http://meu_ip/
Opens magento, when I access:
http://meu_ip/recomendador.com
or
http://meu_ip/www.recomendador.com
Appears was not found on this server.
If I type:
http://meu_ip/magento.com
or
http://meu_ip/www.magento.com
That is, it seems he only recognizes the magento and still no use ServerName or ServerAlias.
I enabled both the a2ensite
Anyone know what might be wrong?
Thanks

Cannot navigate to laravel project via localhost using Apache

I installed a laravel project to /home/user/development. The project is called rpm (/home/user/development/rpm). I also have another project that I have been using at /home/public_html. It's called mgmt (/home/user/public_html/mgmt). I can navigate just fine to mgmt via localhost/mgmt. It's conf file in sites-available is
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /home/user/public_html/
<Directory /home/user/public_html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/rpm-error.log
CustomLog ${APACHE_LOG_DIR}/rpm-access.log combined
</VirtualHost>
Now my laravel project (rpm) does not work. Navigating to localhost/rpm gives a 404.
It's conf file looks like this
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /home/user/development/rpm/public/
Alias /rpm /home/user/development/rpm/public
<Directory /home/user/development/rpm/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/rpm-error.log
CustomLog ${APACHE_LOG_DIR}/rpm-access.log combined
</VirtualHost>
What could be the problem here? Both of those config files have symlinks in the sites-enabled folder.
Modify the first conf to this. Discard the second conf.
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /home/user/public_html/
Alias /rpm /home/user/development/rpm/public
<Directory /home/user/public_html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /home/user/development/rpm/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/rpm-error.log
CustomLog ${APACHE_LOG_DIR}/rpm-access.log combined
</VirtualHost>

Serve documents from alternative document root

I would like Apache to serve documents from c:/Apache24/htdocs and d:/www resp on my Windows local machine. In httpd-vhosts.conf I'm trying:
<VirtualHost *:80>
DocumentRoot "c:/Apache24/htdocs"
ServerName test.localhost
Options Indexes FollowSymLinks
<Directory "D:/www">
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
</VirtualHost>
and in hosts
127.0.0.1 test.localhost
but browsing to http://test.localhost results in a list of directories under C:/htdocs being displayed?
Am I getting any closer with this:
Alias c:/Apache24/htdocs D:/www
<Directory c:/Apache24/htdocs>
Require all granted
</Directory>
If so, where do I add it? N.B. I want to store and serve web documents from D:/ since C:/ is getting rather full now.
check you have row: NameVirtualHost *:80 before your virtual host. That should usually be there already, but check it.
Change your host to point just into one folder like:
<VirtualHost *:80>
DocumentRoot "D:/www"
ServerName localserver
Options Indexes FollowSymLinks
<Directory "D:/www">
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
</VirtualHost>
Create symbolic link from your c:/Apache24/htdocs to for example D:/www/apache folder.
Then you can access to your c:/Apache24/htdocs folder from url:
localserver/apache
Read more about symlinks:
http://en.wikipedia.org/wiki/NTFS_symbolic_link
Another option is to create two urls (domains) and virtualhosts like (add this after above):
<VirtualHost *:80>
DocumentRoot "c:/Apache24/htdocs"
ServerName other.localserver
Options Indexes FollowSymLinks
<Directory "c:/Apache24/htdocs">
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
</VirtualHost>
and in your hosts:
127.0.0.1 localserver other.localserver
On Windows 7 with WAMP installed on C:\Apache24 and serving documents out of C:\Apache24\htdocs you may want to serve documents from the D drive instead, since C is getting full. Go to: C:\Apache24\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "D:/www/apache/site1"
ServerName site1.dev
<Directory "D:/www/apache/site1">
Options Indexes MultiViews
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/www/apache/site2"
ServerName site2.dev
<Directory "D:/www/apache/site2">
Options Indexes MultiViews
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
And edit: C:\Windows\System32\drivers\etc\hosts
127.0.0.1 site1.dev
127.0.0.1 site2.dev
You should now be able to serve (locally) you're web documents from D:\www\apache with no need for sym links.

Categories