Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Problem with virtual hosts in Apache
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
spylinux
n00b
n00b


Joined: 01 Nov 2015
Posts: 2
Location: Brasil

PostPosted: Tue Mar 15, 2016 5:43 pm    Post subject: [SOLVED] Problem with virtual hosts in Apache Reply with quote

Hi everyione,

I made a clean install of Apache and PHP, and works fine.
In /etc/portage/make.conf i have set:

APACHE2_MPMS="prefork"

And in etc/portage/packages.use i set:

www-servers/apache mpm-prefork
app-admin/apache-tools

But i want to use virtualhosts, to access my sites like http://mysite.com not http://localhost/mysite

I have create a file in: /etc/apache2/vhosts.d/cakephp.io.conf with this content:

Code:
<VirtualHost *:80>
   ServerAdmin spylinux@openmailbox.org
   DocumentRoot /var/www/localhost/htdocs/cakephp
   ServerName cakephp.io
   ServerAlias www.cakephp.io
   LogLevel warn
   ErrorLog /var/www/localhost/htdocs/cakephp/logs/error.log
   CustomLog /var/www/localhost/htdocs/cakephp/logs/access.log combined

   <Directory /var/www/localhost/htdocs/cakephp.io>
      Options Indexes FollowSymLinks
      AllowOverride All
      Require all granted
      DirectoryIndex index.html index.php
   </Directory>
</VirtualHost>


And add this line in /etc/hosts
Code:
127.0.0.1       cakephp.io      www.cakephp.io


After restart Apache, when i try to access http://cakephp.io, i have 403 Error - Forbidden. And the Apache log have this:

Code:
[Tue Mar 15 12:41:04.011560 2016] [mpm_prefork:notice] [pid 4061] AH00163: Apache/2.4.18 (Unix) OpenSSL/1.0.2g PHP/5.6.18-pl0-gentoo configured -- resuming normal operations
[Tue Mar 15 12:41:04.011620 2016] [core:notice] [pid 4061] AH00094: Command line: '/usr/sbin/apache2 -D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5 -d /usr/lib64/apache2 -f /etc/apache2/httpd.conf'


Anyone can tell me what i'm doing wrong, or how can i solve this problem about create Virtual Hosts on Gentoo?

Thanks for any help!
spylinux
_________________
In Tux We Trust


Last edited by spylinux on Tue Mar 15, 2016 6:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
kazdva
n00b
n00b


Joined: 14 Mar 2016
Posts: 26

PostPosted: Tue Mar 15, 2016 6:00 pm    Post subject: Re: Problem with virtual hosts in Apache Reply with quote

Code:
<Directory /var/www/localhost/htdocs/cakephp.io>


I think you had in mind /var/www/localhost/htdocs/cakephp
Back to top
View user's profile Send private message
spylinux
n00b
n00b


Joined: 01 Nov 2015
Posts: 2
Location: Brasil

PostPosted: Tue Mar 15, 2016 6:07 pm    Post subject: Re: Problem with virtual hosts in Apache Reply with quote

AdamScheller wrote:
Code:
<Directory /var/www/localhost/htdocs/cakephp.io>


I think you had in mind /var/www/localhost/htdocs/cakephp


Thank you so much @AdamScheller,

I not see before my mistake in Path of directory. Now, works fine!

Again, thanks! :D

Best regards
spylinux
_________________
In Tux We Trust
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum