Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2 Driving me MAD (HELP ME)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Dr_Dooom33
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jan 2005
Posts: 125

PostPosted: Fri Oct 14, 2005 4:18 pm    Post subject: Apache2 Driving me MAD (HELP ME) Reply with quote

In reference to:

GENTOO WIKI SITE
http://gentoo-wiki.com/HOWTO_Apache_VirtualHost_by_IP_Address

THREAD

https://forums.gentoo.org/viewtopic-p-2686304.html#2686304


After following gentoo wiki instructions I am failing: :? :? :? :? :? :?

/etc/init.d/apache2 restart
* Starting apache2 ...
[Fri Oct 14 09:03:26 2005] [warn] NameVirtualHost *:80 has no VirtualHos [ !! ]


/etc/apache2/conf/apache2.conf
Code:


### Main Configuration Section
### You really shouldn't change these settings unless you're a guru
###
ServerRoot /usr/lib/apache2
ServerName yourserver.yourdomain.com
#LockFile /etc/apache2/apache2.lock
PidFile /var/run/apache2.pid
ErrorLog logs/error_log
LogLevel warn
DocumentRoot /var/www/localhost/htdocs

###
### Virtual Hosts
###
# We include different templates for Virtual Hosting. Have a look in the
# vhosts directory and modify to suit your needs.
Include conf/vhosts/vhosts.conf
#Include conf/vhosts/dynamic-vhosts.conf
#Include conf/vhosts/virtual-homepages.conf



/etc/conf.d/apache2

Code:

# Config file for /etc/init.d/apache2

# An example from /etc/apache2/conf/modules.d/40_mod_ssl.conf:
#
# <IfDefine SSL>
#  <IfModule !mod_ssl.c>
#    LoadModule ssl_module    extramodules/mod_ssl.so
#  </IfModule>
# </IfDefine>
#
# This means that the mod_ssl.so DSO module is only loaded
# into the server when you pass "-D SSL" at startup.  To
# enable WebDAV, add "-D DAV -D DAV_FS".  If you installed
# mod_php then add "-D PHP4".  For more options, please
# read the files in the /etc/apache2/conf/modules.d directory.

APACHE2_OPTS="-D PHP4 -D SSL"



/etc/apache2/conf/vhosts/vhosts.conf
Code:


#### LocalHost aka Domain 1 ####
 <VirutalHost my.ip.add.ress>
       ServerName www.mydomain1.com
       ServerPath /mydomain1.com
       DocumentRoot /var/www/localhost/htdocs
 </VirtualHost>

 #### Domain 2 ####
 <VirtualHost my.ip.add.ress>
        ServerName www.mydomain2.com
        DocumentRoot /var/www/mydomain2.com/htdocs
        <Directory "/var/www/mydomain2.com/htdocs">
          Options None
          AllowOverride None
          Order allow,deny
          Allow from all
        </Directory>
 </VirtualHost>

 #### Replicate Domain 2 for further Domains ####
                                ""
                               ""
<Directory "/var/www/mydomain2.com/htdocs">
         Options None
         AllowOverride None
         Order allow,deny
         Allow from all
</Directory>





/etc/apache2/listen.conf (I had no listen.conf file so I made one)


Code:


NameVirtualHost *



Code:
[color=green]
# /etc/init.d/apache2 restart
[/color]

Then I get

Code:

/etc/init.d/apache2 restart
 * Starting apache2 ...
[Fri Oct 14 09:03:26 2005] [warn] NameVirtualHost *:80 has no VirtualHos [ !! ]




Im frustrated :evil: :evil: :evil: :evil:
_________________
Kernel: Linux 2.6.12-gentoo-r10
Intel(R) Pentium(R) 4 CPU 3.20GHz
cpu MHz: 3201.641
cache size: 512 KB
2 Muskin 512MB 3200 = 1GB
ATI Radeon 9600 256MB
Soundblaster Live
WD 7200 rpm 90 GB
Maxtor 7200 rpm 160 GB
Back to top
View user's profile Send private message
c4
Guru
Guru


Joined: 21 Feb 2004
Posts: 312
Location: Sweden

PostPosted: Fri Oct 14, 2005 6:09 pm    Post subject: Reply with quote

Dr_Dooom33, from the guide you mentioned
Quote:
It also assumes that you are using IP Aliasing. But if you are not and you use name based vitual host you can simply replace the "VirtualHost MY.IP.ADD.RESS" with *:80 or whatever..


I see that for Apache I use the *:80 setup for my virtual hosts:

(vhosts.conf)

Code:
<VirtualHost *:80>
ServerName domainname.com
ServerAlias domainname.com
DocumentRoot /www/domainname
   <Directory "/www/domainname">
     allow from all
    </Directory>
</VirtualHost>


and simular for my second virtualhost:
Code:
<VirtualHost *:80>
ServerName domainname2.com
ServerAlias domainname2.com
DocumentRoot /www/domainname2
   <Directory "/www/domainname2">
     allow from all
    </Directory>
</VirtualHost>


and it works just fine.
_________________
AMD64 Gentoo Hardened server
AMD64 Xubuntu Desktop
X86 Dreamlinux Vaio laptop
Back to top
View user's profile Send private message
Onkobu
n00b
n00b


Joined: 10 Oct 2005
Posts: 36

PostPosted: Fri Oct 14, 2005 6:19 pm    Post subject: Just asking for file structure Reply with quote

You uncommented the server root and included the vhosts.conf RELATIVE (no trailing slash) to this server root, does vhosts.conf exist under $SERVER_ROOT/$VHOST_CONF? (I remember that there's a lot of linking on x86_64, lib, lib32, lib64...)
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Fri Oct 14, 2005 6:47 pm    Post subject: Re: Apache2 Driving me MAD (HELP ME) Reply with quote

Dr_Dooom33 wrote:
Im frustrated :evil: :evil: :evil: :evil:


I'd like to just throw this out there.

If you are using the most recent version of apache2 in portage your configuration files are in the wrong locations.

reference:
http://www.gentoo.org/doc/en/apache-upgrading.xml
This is a guide to correcting the configuration file issues brought on by the changes in the newest ebuild.

for instance: /etc/apache2/conf/apache2.conf
should be /etc/apache2/httpd.conf and vhosts are in /etc/apache2/vhosts/vhosts.conf.

I had the exact same error message when starting/stopping apache2 after updating it but prior to changin gmy config file locations.


frustrating is an understatement :evil:

- Jon
Back to top
View user's profile Send private message
DNAspark99
Guru
Guru


Joined: 03 Sep 2004
Posts: 321

PostPosted: Fri Oct 14, 2005 7:10 pm    Post subject: Reply with quote

if you havn't allready....I recommend upgrading to the newest ebuild, you may as well get whatever 'breakage' you'll encounter over with now, rather than fix this issue only to break it when you eventually DO upgrade... :P

might want to try:
/etc/conf.d/apache2:
Quote:

APACHE2_OPTS="-D DEFAULT_VHOST -D SSL_DEFAULT_VHOST -D SSL -D PHP4"


That should set up everything you need for vhosts, you shouldn't need to fiddle with the httpd.conf to get this working

It will greatly 'simplify' a few things if you split your individual vhosts into seperate .conf files, put them in /etc/apache2/vhosts.d/, and just make sure that you have "Include /etc/apache2/vhosts.d/*.conf" as the last line of /etc/apache2/httpd.conf (believe this is default now anyways)
Back to top
View user's profile Send private message
elcman
n00b
n00b


Joined: 13 Mar 2004
Posts: 4
Location: Utah

PostPosted: Fri Oct 14, 2005 11:57 pm    Post subject: Reply with quote

DNAspark99 wrote:

might want to try:
/etc/conf.d/apache2:


Doesn't this disallow Apache2 from even running? If it sees the old config files in the old locations it will now allow Apache2 to start.

init.d/apache2 wrote:

# check to see if the old config files exist and aren't used
if [[ "${CONFIGFILE}" != "/etc/apache2/conf/apache2.conf" &&
-e "/etc/apache2/conf/apache2.conf" ]]; then
eerror "Found old apache2.conf in /etc/apache2/conf. Configuration locations \n have moved, please check ${CONFIGFILE} to make sure it is correct, \n and remove /etc/apache2/conf/apache2.conf.\n\n Please see http://www.gentoo.org/doc/en/apache-upgrading.xml\n for more information."
return 1
fi


If this is the case, where do I Define The following?

Obsolete conf.d/apache2.conf wrote:

APACHE2_OPTS="-D DEFAULT_VHOST -D SSL_DEFAULT_VHOST -D SSL -D PHP4"


Because if I put this verbatim into httpd.conf I get:

* Apache2 has detected a syntax error in your configuration files:
Syntax error on line 1095 of /etc/apache2/httpd.conf:
Invalid command 'APACHE2_OPTS="-D', perhaps mis-spelled or defined by a module not included in the server configuration

So, where do I Define each of these elements? The modules.d loading process doesn't seem to pick them up.

Any help would be awesome. :)
_________________
--
ElcMan
Back to top
View user's profile Send private message
c4
Guru
Guru


Joined: 21 Feb 2004
Posts: 312
Location: Sweden

PostPosted: Sat Oct 15, 2005 12:21 am    Post subject: Reply with quote

elcman wrote:
If this is the case, where do I Define The following?

Obsolete conf.d/apache2.conf wrote:

APACHE2_OPTS="-D DEFAULT_VHOST -D SSL_DEFAULT_VHOST -D SSL -D PHP4"




Those options are to be used in the /etc/conf.d/apache2 file, when using the new Apache setup including httpd.conf. If you are using the old Apache server setup with the apache.conf/commonapache.conf files, then I think that the /etc/conf.d/apache2 should be like
Code:
APACHE2_OPTS="-D SSL -D PHP4"
instead.. but check the guides because I'm not sure about the old setup anymore. I don't have any older configs to check here either I'm afraid.
_________________
AMD64 Gentoo Hardened server
AMD64 Xubuntu Desktop
X86 Dreamlinux Vaio laptop
Back to top
View user's profile Send private message
DNAspark99
Guru
Guru


Joined: 03 Sep 2004
Posts: 321

PostPosted: Sat Oct 15, 2005 1:11 am    Post subject: Reply with quote

yes, that's my point - if you havn't upgraded yet, do it now, save yourself the trouble later!
the new apache layout is a bit better, having httpd.conf makes more sense, and configs can be switched pretty quickly... in my case, the upgrade consisted of:

(after latest apache2 freshly merged)
Code:

mv /etc/apache2/conf/vhosts/*.conf /etc/apache2/vhosts.d/
mv /etc/apache2/conf/ssl/* /etc/apache2/ssl/
mv /etc/apache2/conf /etc/apache2/OLDconf


...THEN my previous post will make more sense :p
Back to top
View user's profile Send private message
Dr_Dooom33
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jan 2005
Posts: 125

PostPosted: Sat Oct 15, 2005 1:39 am    Post subject: Reply with quote

how do I emerge the latest?

Sorry Im a NooB

emerge apache


right or do I have to give a particular version name to get the latest?

Do I need to unmerge the current apache?
_________________
Kernel: Linux 2.6.12-gentoo-r10
Intel(R) Pentium(R) 4 CPU 3.20GHz
cpu MHz: 3201.641
cache size: 512 KB
2 Muskin 512MB 3200 = 1GB
ATI Radeon 9600 256MB
Soundblaster Live
WD 7200 rpm 90 GB
Maxtor 7200 rpm 160 GB
Back to top
View user's profile Send private message
Dr_Dooom33
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jan 2005
Posts: 125

PostPosted: Sat Oct 15, 2005 2:11 am    Post subject: Reply with quote

Onkobu

Quote:
You uncommented the server root and included the vhosts.conf RELATIVE (no trailing slash) to this server root, does vhosts.conf exist under $SERVER_ROOT/$VHOST_CONF? (I remember that there's a lot of linking on x86_64, lib, lib32, lib64...)



I dont understand can you explain to a noob please
_________________
Kernel: Linux 2.6.12-gentoo-r10
Intel(R) Pentium(R) 4 CPU 3.20GHz
cpu MHz: 3201.641
cache size: 512 KB
2 Muskin 512MB 3200 = 1GB
ATI Radeon 9600 256MB
Soundblaster Live
WD 7200 rpm 90 GB
Maxtor 7200 rpm 160 GB
Back to top
View user's profile Send private message
DNAspark99
Guru
Guru


Joined: 03 Sep 2004
Posts: 321

PostPosted: Sat Oct 15, 2005 3:37 am    Post subject: Reply with quote

Dr_Dooom33 wrote:
how do I emerge the latest?

Sorry Im a NooB

emerge apache


right or do I have to give a particular version name to get the latest?

Do I need to unmerge the current apache?



emerge sync && emerge apache
Back to top
View user's profile Send private message
elcman
n00b
n00b


Joined: 13 Mar 2004
Posts: 4
Location: Utah

PostPosted: Sat Oct 15, 2005 5:02 am    Post subject: Reply with quote

c4 wrote:
elcman wrote:
If this is the case, where do I Define The following?

Obsolete conf.d/apache2.conf wrote:

APACHE2_OPTS="-D DEFAULT_VHOST -D SSL_DEFAULT_VHOST -D SSL -D PHP4"




Those options are to be used in the /etc/conf.d/apache2 file, when using the new Apache setup including httpd.conf. If you are using the old Apache server setup with the apache.conf/commonapache.conf files, then I think that the /etc/conf.d/apache2 should be like
Code:
APACHE2_OPTS="-D SSL -D PHP4"
instead.. but check the guides because I'm not sure about the old setup anymore. I don't have any older configs to check here either I'm afraid.


I went through and looked at different methods of configuration. Most of which I tried manually. The additions to the /etc/conf.d/apache2.conf didn't crap out like I expected it would, but it didn't actually define it either. I am closer to understanding the problem, but the solution still seems to be as far away as ever.

I tried putting this same information into the apache2common.conf as well and I had similar results, it doesn't load modules correctly.

In the default VHOST configuration file, I have to comment out the <IsDefined DEFAULT_VHOST> or it will give me the usualy "no VHOST" error.

The above configuration line seems to be correct as I have been checking all of the <IsDefined> tags and seeing that the appropriate names are called. Am I doing something very wrong? Right now, my PHP scripts won't execute. It just doesn't recognize them as anything more than a text file. The commands are imbedded in the PHP4 module, but unless I can somehow define the environment, I won't be able to get it running without Jerry-rigging it.

I've looked through the documentation... maybe I'm just looking in the wrong place.

-- Edit

The Docs wrote:

Note: Many modules that used to be enabled by default are now disabled. If they are apache built-in modules, then uncomment the appropriate line in httpd.conf. If they are external modules, check the module's .conf for IfDefine and add the name to /etc/conf.d/apache{|2} to enable it.


Ok, I was looking in the wrong place.
_________________
--
ElcMan
Back to top
View user's profile Send private message
Onkobu
n00b
n00b


Joined: 10 Oct 2005
Posts: 36

PostPosted: Sat Oct 15, 2005 10:57 am    Post subject: Read the screen messages/manuals/man pages Reply with quote

Dr_Dooom33 wrote:
Onkobu

Quote:
You uncommented the server root and included the vhosts.conf RELATIVE (no trailing slash) to this server root, does vhosts.conf exist under $SERVER_ROOT/$VHOST_CONF? (I remember that there's a lot of linking on x86_64, lib, lib32, lib64...)



I dont understand can you explain to a noob please

That happens, but it's not your fault. Due to your lack of knowledge you should look for help not only here. There are a lot of man pages (emerge, portage, equery), many How To's (esp. gentoo with it's wikis) and tons of screen messages.

Do not just "emerge world" but spool it to some file:

emerge world | tee /tmp/portage.log

After emerge finished, read the lines starting with '*' and when talking 'bout apache2 you can read something like: "Configuration file changed...now under /usr/..."
When you look at the comments within apache's conf-files, there's sometimes written: "only change if you're master of the known universe". As a "noob" this condition is false and you should never change these settings (even if it's funky to not have everything like others).

To draw a conclusion:
1. you changed a config which had no effect
2. There was an error message in apache's startup log
-> You're wrong (or it's an apache bug)
-> Have a look at some "How To configure apache" (scroll a bit up, the xml-Link)
-> Next time: be aware of emerge messages starting with '*'
-> Read the man pages for "emerge" and "portage"
(You don't have to unmerge packages, portage replaces them automatically or installs concurrent versions if possible [e.g. kernel sources])
Back to top
View user's profile Send private message
Dr_Dooom33
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jan 2005
Posts: 125

PostPosted: Mon Oct 17, 2005 2:03 am    Post subject: Re: Apache2 Driving me MAD (HELP ME) Reply with quote

jonnevers wrote:
Dr_Dooom33 wrote:
Im frustrated :evil: :evil: :evil: :evil:


I'd like to just throw this out there.

If you are using the most recent version of apache2 in portage your configuration files are in the wrong locations.

reference:
http://www.gentoo.org/doc/en/apache-upgrading.xml
This is a guide to correcting the configuration file issues brought on by the changes in the newest ebuild.

for instance: /etc/apache2/conf/apache2.conf
should be /etc/apache2/httpd.conf and vhosts are in /etc/apache2/vhosts/vhosts.conf.

I had the exact same error message when starting/stopping apache2 after updating it but prior to changin gmy config file locations.


frustrating is an understatement :evil:

- Jon


emerge --verbose --update --newuse --deep apache subversion mod_php \
> mod_bandwidth mod_layout mod_ldap_userdir mod_loopback mod_mp3 mod_random \
> mod_throttle mod_watch
Calculating dependencies |
!!! All ebuilds that could satisfy "mod_watch" have been masked.
!!! One of the following masked packages is required to complete your request:
- net-www/mod_watch-4.03-r1 (masked by: ~x86 keyword)
- net-www/mod_watch-3.18-r1 (masked by: ~x86 keyword)
- net-www/mod_watch-4.03 (masked by: ~x86 keyword)
- net-www/mod_watch-3.18 (masked by: ~x86 keyword)

For more information, see MASKED PACKAGES section in the emerge man page or
section 2.2 "Software Availability" in the Gentoo Handbook.


Thats what I got. I cant continue on through the steps at

[url]
http://www.gentoo.org/doc/en/apache-upgrading.xml[/url]
_________________
Kernel: Linux 2.6.12-gentoo-r10
Intel(R) Pentium(R) 4 CPU 3.20GHz
cpu MHz: 3201.641
cache size: 512 KB
2 Muskin 512MB 3200 = 1GB
ATI Radeon 9600 256MB
Soundblaster Live
WD 7200 rpm 90 GB
Maxtor 7200 rpm 160 GB
Back to top
View user's profile Send private message
DNAspark99
Guru
Guru


Joined: 03 Sep 2004
Posts: 321

PostPosted: Mon Oct 17, 2005 2:08 am    Post subject: Reply with quote

try
Code:
echo "net-www/mod_watch ~x86" >> /etc/portage/package.keywords
Back to top
View user's profile Send private message
Dr_Dooom33
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jan 2005
Posts: 125

PostPosted: Mon Oct 17, 2005 2:10 am    Post subject: Re: Apache2 Driving me MAD (HELP ME) Reply with quote

jonnevers wrote:
Dr_Dooom33 wrote:
Im frustrated :evil: :evil: :evil: :evil:


I'd like to just throw this out there.

If you are using the most recent version of apache2 in portage your configuration files are in the wrong locations.

reference:
http://www.gentoo.org/doc/en/apache-upgrading.xml
This is a guide to correcting the configuration file issues brought on by the changes in the newest ebuild.

for instance: /etc/apache2/conf/apache2.conf
should be /etc/apache2/httpd.conf and vhosts are in /etc/apache2/vhosts/vhosts.conf.

I had the exact same error message when starting/stopping apache2 after updating it but prior to changin gmy config file locations.


frustrating is an understatement :evil:

- Jon


/etc/apache2/vhosts/vhosts.conf.

vhost directory does not exist. Should I make the directory?
_________________
Kernel: Linux 2.6.12-gentoo-r10
Intel(R) Pentium(R) 4 CPU 3.20GHz
cpu MHz: 3201.641
cache size: 512 KB
2 Muskin 512MB 3200 = 1GB
ATI Radeon 9600 256MB
Soundblaster Live
WD 7200 rpm 90 GB
Maxtor 7200 rpm 160 GB
Back to top
View user's profile Send private message
c4
Guru
Guru


Joined: 21 Feb 2004
Posts: 312
Location: Sweden

PostPosted: Mon Oct 17, 2005 11:03 am    Post subject: Reply with quote

Yes, or you could also adjust your httpd.conf and tell it where your vhosts-configurations files are. The default location for the new apache setup is in /etc/apache2/vhosts/
---------------------------------------------
Here's some slighty offtopic info about what I did when uppgrading to the new layout.
Backup the current apache-configuration files
Code:
mv /etc/apache2 /etc/apache2_old
mv /etc/conf.d/apache2 /etc/conf.d/apache2_old

emerge apache  (get the latest stable, currently version 2.0.54-r31 in portage for x86)


Get apache up and running by setting your servername in the httpd.conf file and then start apache
Code:
/etc/init.d/apache2 start


If all is ok and apache is serving http-pages ok, than add support for php, ssl, vhost and all other things you need.
When apache was working ok I copied my old vhost.conf to the new vhost directory and I believe that was it. Add the correct info to your /etc/conf.d/apache2 file and you're all set again.


Some of the php-modules are still being masked as testing, but in such cases
Code:
try
echo "net-www/mod_watch ~x86" >> /etc/portage/package.keywords
as DNAspark99 wrote.
_________________
AMD64 Gentoo Hardened server
AMD64 Xubuntu Desktop
X86 Dreamlinux Vaio laptop
Back to top
View user's profile Send private message
dan2003
Apprentice
Apprentice


Joined: 11 May 2003
Posts: 258
Location: somewhere near london, UK

PostPosted: Mon Oct 17, 2005 9:51 pm    Post subject: Reply with quote

I'm pulling my hair out here!! I have previously had vhosts working fine, but since updating after installing the new dev-lang/php y apache vhosts config refuses to work.

I have my home website (which hasnt seen much work recently) and a work site im developing and hostsing on the same box

I Used to have these all in the one file but since the headcahe began has split it into 2

vhosts.d/home.conf
Code:

<VirtualHost *:80>
    DocumentRoot /var/www/home.example.com/htdocs
    ServerName home.example.com
    ErrorLog /var/log/apache2/home.example.com-error_log
    CustomLog /var/log/apache2/home.example.com-access_log common
</VirtualHost>


vhosts.d/work.conf
Code:

<VirtualHost *:80>
    ServerName work.example.com
    DocumentRoot /var/www/work.example.com/htdocs
    <Directory "/var/www/work.example.com/htdocs">
          Options None
          AllowOverride None
          Order allow,deny
          Allow from all
    </Directory>
    ErrorLog /var/log/apache2/work.example.com-error_log
    CustomLog /var/log/apache2work.example.com-access_log common
</VirtualHost>


Now these two appear too work ok, but my work site has secure area on https or port 443, and this is where the problem has risen.
If i try https://work.example.com i'm treated too

Forbidden
You don't have permission to access / on this server.
Apache Server at ds.homedns.org Port 443

And if i replace the 80 with * in the work.conf, it goes to the home site!! and if i add a second entry in work.conf with 443 instead of 80 it again goes to the home site.

So my question is, how do i set it u so that https and http will look in /var/www/work.example.com when i goto work.example.com and goto /var/www/home.example.com when i goto home.example.com ?
_________________
Too easy!
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Mon Oct 17, 2005 11:38 pm    Post subject: Reply with quote

dan2003 wrote:
I'm pulling my hair out here!!
Forbidden
You don't have permission to access / on this server.
Apache Server at ds.homedns.org Port 443


sounds like a permissions problem. the default user used by apache is 'apache'. it is possible that the user 'apache' dosen't have read permission (possibly even execute persmission) on the files for the SSL vhost.
Back to top
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Mon Oct 17, 2005 11:46 pm    Post subject: Reply with quote

jonnevers wrote:
dan2003 wrote:
I'm pulling my hair out here!!
Forbidden
You don't have permission to access / on this server.
Apache Server at ds.homedns.org Port 443


sounds like a permissions problem. the default user used by apache is 'apache'. it is possible that the user 'apache' dosen't have read permission (possibly even execute persmission) on the files for the SSL vhost.


Indexes are turned off by default ;)

Change Options None into Options Indexes.
Back to top
View user's profile Send private message
dan2003
Apprentice
Apprentice


Joined: 11 May 2003
Posts: 258
Location: somewhere near london, UK

PostPosted: Tue Oct 18, 2005 8:22 am    Post subject: Reply with quote

hehe, sorry giys i dont think either of these are relevant, but thanks anyway. Te file for both hosts are in the same. just certain unctionality in the sripts will refuse to work over a non ssl conection. Also i deliberatly dont want indexing enabled.

https://work.exmaple.com should reveal the same page as http://work.exmaple.com. but for some reason it would would seem it is posinting to /var/www/localhost/htdocs. I have removed -D DEFAULT_HOST from/etc/conf.d/apache so this shouldnt happen as far as i know.
_________________
Too easy!
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Tue Oct 18, 2005 1:31 pm    Post subject: Reply with quote

dan2003 wrote:
hehe, sorry giys i dont think either of these are relevant, but thanks anyway. Te file for both hosts are in the same. just certain unctionality in the sripts will refuse to work over a non ssl conection. Also i deliberatly dont want indexing enabled.

https://work.exmaple.com should reveal the same page as http://work.exmaple.com. but for some reason it would would seem it is posinting to /var/www/localhost/htdocs. I have removed -D DEFAULT_HOST from/etc/conf.d/apache so this shouldnt happen as far as i know.


I wouldn't turn indexing on either, it is a bad practice.

I highly doubt there is 'functionality in the scripts' that dosen't work over SSL. SSL is just a transmission protocol.


Code:
vi /etc/apache2/modules.d/41_mod_ssl.default-vhost.conf

<VirtualHost 68.174.79.31:443>

#  General setup for the virtual host
DocumentRoot "/dir/to/files/secure"
ServerName secure.monkeydisaster.net
ServerAdmin admin@mail.monkeydisaster.net

    <Directory /dir/to/files/secure>
       AllowOverride All
       Order deny,allow
    </Directory>


ErrorLog logs/ssl_error_log
<IfModule mod_log_config.c>
TransferLog logs/ssl_access_log
</IfModule>


a version or two back of apache, i had to add the <Directory> tags into the vhost's declarations (for SSL and non-SSL vhosts). That also contributed to me receiving the "do not have permission to view" error.
Back to top
View user's profile Send private message
Dr_Dooom33
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jan 2005
Posts: 125

PostPosted: Tue Oct 18, 2005 5:11 pm    Post subject: Reply with quote

DNAspark99 wrote:
if you havn't allready....I recommend upgrading to the newest ebuild, you may as well get whatever 'breakage' you'll encounter over with now, rather than fix this issue only to break it when you eventually DO upgrade... :P

might want to try:
/etc/conf.d/apache2:
Quote:

APACHE2_OPTS="-D DEFAULT_VHOST -D SSL_DEFAULT_VHOST -D SSL -D PHP4"


That should set up everything you need for vhosts, you shouldn't need to fiddle with the httpd.conf to get this working

It will greatly 'simplify' a few things if you split your individual vhosts into seperate .conf files, put them in /etc/apache2/vhosts.d/, and just make sure that you have "Include /etc/apache2/vhosts.d/*.conf" as the last line of /etc/apache2/httpd.conf (believe this is default now anyways)


After I add "Include /etc/apache2/vhosts.d/*.conf" as the last line of /etc/apache2/httpd.conf

I get the following when I:

Code:
/etc/init.d/apache2 start
 * Unable to read configuration file: /etc/apache2/conf/apache2.conf

_________________
Kernel: Linux 2.6.12-gentoo-r10
Intel(R) Pentium(R) 4 CPU 3.20GHz
cpu MHz: 3201.641
cache size: 512 KB
2 Muskin 512MB 3200 = 1GB
ATI Radeon 9600 256MB
Soundblaster Live
WD 7200 rpm 90 GB
Maxtor 7200 rpm 160 GB
Back to top
View user's profile Send private message
Dr_Dooom33
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jan 2005
Posts: 125

PostPosted: Tue Oct 18, 2005 5:17 pm    Post subject: Re: Apache2 Driving me MAD (HELP ME) Reply with quote

jonnevers wrote:
Dr_Dooom33 wrote:
Im frustrated :evil: :evil: :evil: :evil:


I'd like to just throw this out there.

If you are using the most recent version of apache2 in portage your configuration files are in the wrong locations.

reference:
http://www.gentoo.org/doc/en/apache-upgrading.xml
This is a guide to correcting the configuration file issues brought on by the changes in the newest ebuild.

for instance: /etc/apache2/conf/apache2.conf
should be /etc/apache2/httpd.conf and vhosts are in /etc/apache2/vhosts/vhosts.conf.

I had the exact same error message when starting/stopping apache2 after updating it but prior to changin gmy config file locations.


frustrating is an understatement :evil:

- Jon


dont you mean

Code:

 /etc/apache2/vhosts.d/vhosts.conf

_________________
Kernel: Linux 2.6.12-gentoo-r10
Intel(R) Pentium(R) 4 CPU 3.20GHz
cpu MHz: 3201.641
cache size: 512 KB
2 Muskin 512MB 3200 = 1GB
ATI Radeon 9600 256MB
Soundblaster Live
WD 7200 rpm 90 GB
Maxtor 7200 rpm 160 GB
Back to top
View user's profile Send private message
DNAspark99
Guru
Guru


Joined: 03 Sep 2004
Posts: 321

PostPosted: Tue Oct 18, 2005 6:31 pm    Post subject: Reply with quote

dan2003 wrote:
I'm pulling my hair out here!! I have previously had vhosts working fine, but since updating after installing the new dev-lang/php y apache vhosts config refuses to work.

I have my home website (which hasnt seen much work recently) and a work site im developing and hostsing on the same box

I Used to have these all in the one file but since the headcahe began has split it into 2

And if i replace the 80 with * in the work.conf, it goes to the home site!! and if i add a second entry in work.conf with 443 instead of 80 it again goes to the home site.

So my question is, how do i set it u so that https and http will look in /var/www/work.example.com when i goto work.example.com and goto /var/www/home.example.com when i goto home.example.com ?


shouldn't https have it's own IP specified if you're using SSL? "*:443" may lead to 'issues', maybe not with one vhost but it's bound to have problems with anything more ?

vhosts.d/home.conf
Code:

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot /var/www/home.example.com/htdocs
    ServerName home.example.com
    ErrorLog /var/log/apache2/home.example.com-error_log
    CustomLog /var/log/apache2/home.example.com-access_log common
</VirtualHost>


vhosts.d/work.conf
Code:

NameVirtualHost 192.168.1.2:80
<VirtualHost *:80>
    ServerName work.example.com
    DocumentRoot /var/www/work.example.com/htdocs
    <Directory "/var/www/work.example.com/htdocs">
          Options None
          AllowOverride None
          Order allow,deny
          Allow from all
    </Directory>
    ErrorLog /var/log/apache2/work.example.com-error_log
    CustomLog /var/log/apache2work.example.com-access_log common
</VirtualHost>
<VirtualHost 192.168.1.2:443>
    ServerName work.example.com
    DocumentRoot /var/www/work.example.com/htdocs
    <Directory "/var/www/work.example.com/htdocs">
          Options None
          AllowOverride None
          Order allow,deny
          Allow from all
    </Directory>
    ErrorLog /var/log/apache2/work.example.com-error_log
    CustomLog /var/log/apache2work.example.com-access_log common
    SSLEngine on
    SSLCertificateKeyFile conf/ssl/work.example.com.key
    SSLCertificateFile conf/ssl/work.example.com.crt
</VirtualHost>

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
Goto page 1, 2, 3  Next
Page 1 of 3

 
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