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
Related
<VirtualHost *:80>
ServerName oj.mbstu.ac.bd
ServerAlias www.oj.mbstu.ac.bd
ServerAdmin webmaster#oj.mbstu.ac.bd
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
/etc/hosts
127.0.0.1 oj.mbstu.ac.bd
103.28.121.75 oj.mbstu.ac.bd
<VirtualHost *:80>
ServerAdmin yourname#localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
This is the proper configuration, but as i can see your document root /var/www/ includes the html, just remove the conf document and include you own index.
Then just restart the apache server
sudo service apache2 reload
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.
I went to /etc/apache2/sites-available/default-ssl and updated the document root when it is accessing ssl. However, for some reason, it's still pointing to /var/www. I have reloaded and restarted apache2 server using sudo service apache2 reload and sudo service apache2 restart but the changes are still not reflecting. Are there other places that I need to change to make the https://localhost/ points to /home/student/public_html?
The first few lines of default-ssl:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin temp#temp.com
ServerName localhost
DocumentRoot /home/student/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/student/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
The first few lines of default:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /home/student/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/student/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
Redirect "/" "https://localhost/"
I deleted all browser history and it starts working now. :)
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.
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>