Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat May 28, 2011 11:43 pm 
Offline
Senior Newbie

Joined: Sat May 28, 2011 11:12 pm
Posts: 13
Patience please!

I tried to get a CentOS LAMP server up and running according to the Library. At first I couldn't start httpd because I hadn't made the appropriate directories, and then I had made a simple syntax typo. Now, however, starting httpd fails without any error messages, so I don't know what to fix.

Here is my /etc/httpd/conf.d/vhost.conf
Code:
NameVirtualHost 66.228.34.184:80

<VirtualHost 66.228.34.184:80>
        ServerAdmin     mail@ianegland.com
        ServerName   ianegland.com
        ServerAlias     www.ianegland.com
        DocumentRoot    /srv/www/ianegland.com/public_html
        ErrorLog        /srv/www/ianegland.com/logs/error.log
        CustomLog   /srv/www/ianegland.com/logs/access.log combined
</VirtualHost>

<VirtualHost 66.228.34.184:80>
        ServerAdmin     mail@ianegland.com
        ServerName   echolynx.com
        ServerAlias     www.echolynx.com
        DocumentRoot    /srv/www/echolynx.com/public_html
        ErrorLog        /srv/www/echolynx.coml/logs/error.log
        CustomLog   /srv/www/echolynx.com/log/access.log combined
</VirtualHost>


What did I miss?


Last edited by EchoLynx on Wed Jun 01, 2011 8:08 pm, edited 1 time in total.

Top
   
PostPosted: Sun May 29, 2011 12:49 am 
Offline
Senior Member

Joined: Sun Oct 30, 2005 7:52 pm
Posts: 97
EchoLynx wrote:
What did I miss?

Verify no configuration errors with:
apachectl -S

Check the error log:
/var/log/httpd/error_log

--
Travis


Top
   
 Post subject: "Unable to open logs"
PostPosted: Sun May 29, 2011 9:10 am 
Offline
Senior Newbie

Joined: Sat May 28, 2011 11:12 pm
Posts: 13
Thanks for the fast reply!

Output from apachectl -S
Code:
[root@theGreenBox logs]# apachectl -S
VirtualHost configuration:
66.228.34.184:80       is a NameVirtualHost
         default server ianegland.com (/etc/httpd/conf.d/vhost.conf:3)
         port 80 namevhost ianegland.com (/etc/httpd/conf.d/vhost.conf:3)
         port 80 namevhost echolynx.com (/etc/httpd/conf.d/vhost.conf:12)
Syntax OK


/var/log/httpd/error_log contained a bunch of errors complaining about being unable to access access.log, so I created that file for both sites and cleared error_log. Unfortunately, there is still more to be fixed.

error_log after /etc/init.d/httpd start
Code:
Unable to open logs


What's next?


Top
   
 Post subject:
PostPosted: Sun May 29, 2011 9:43 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
It's probably a permissions problem, make sure apache has write permissions to it's log files.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject: Permission Problems
PostPosted: Mon May 30, 2011 5:57 pm 
Offline
Senior Newbie

Joined: Sat May 28, 2011 11:12 pm
Posts: 13
My linux ineptitude is showing.
I tried to get the permissions the way I thought they would need to be, but apparently I am doing something wrong.

/svr/www/ianegland.com/logs
Code:
[root@theGreenBox logs]# ls -lsh
total 4.0K
4.0K -rwxr-x--x 1 apache apache 1 May 30 08:54 access.log
   0 -rwxr-x--x 1 apache apache 0 May 30 08:54 error.log

/svr/www/echolynx.com/logs
Code:
[root@theGreenBox logs]# ls -lsh
total 4.0K
4.0K -rwxr-x--x 1 apache apache 1 May 30 08:47 access.log
   0 -rwxr-x--x 1 apache apache 0 May 30 08:47 error.log


Code:
[root@theGreenBox logs]# cat /var/log/httpd/error_log
Unable to open logs


Top
   
 Post subject:
PostPosted: Mon May 30, 2011 6:44 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
ermm well you don't need execute permission on group and others.

You're probably going to want to chmod 0644 the logs and make sure the group is writable by the apache user which is probably either apache/apache2/www-data

I don't use apache but these are my nginx permissions which I imagine will be the same

-rw-r----- 1 www-data adm 19K 2011-05-30 22:40 access.log

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject: Permissions
PostPosted: Mon May 30, 2011 7:20 pm 
Offline
Senior Newbie

Joined: Sat May 28, 2011 11:12 pm
Posts: 13
Well, I selected apache because that seemed to be the only webserver-ish user in /etc/passwd (see last line)
Code:
[root@theGreenBox mail]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi-autoipd:x:100:102:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin

... and it appears to be in the correct group (last line)...
Code:
[root@theGreenBox logs]# cat /etc/group
root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin,adm
adm:x:4:root,adm,daemon
tty:x:5:
disk:x:6:root
lp:x:7:daemon,lp
mem:x:8:
kmem:x:9:
wheel:x:10:root
mail:x:12:mail
news:x:13:news
uucp:x:14:uucp
man:x:15:
games:x:20:
gopher:x:30:
dip:x:40:
ftp:x:50:
lock:x:54:
nobody:x:99:
users:x:100:
utmp:x:22:
utempter:x:35:
floppy:x:19:
vcsa:x:69:
pcap:x:77:
slocate:x:21:
dbus:x:81:
audio:x:63:
rpc:x:32:
mailnull:x:47:
smmsp:x:51:
sshd:x:74:
ecryptfs:x:101:
haldaemon:x:68:
avahi-autoipd:x:102:
screen:x:84:
ntp:x:38:
apache:x:48:


As for making apache (user) writeable to apache (group) - I don't know how to do that.

I can change the permissions, though.

Code:
[root@theGreenBox logs]# ls -lsh
total 4.0K
4.0K -rw-r--r-- 1 apache apache 1 May 30 08:47 access.log
   0 -rw-r--r-- 1 apache apache 0 May 30 08:47 error.log


Top
   
 Post subject:
PostPosted: Tue May 31, 2011 12:37 am 
Offline
Senior Member

Joined: Wed Mar 03, 2010 2:04 pm
Posts: 111
I don't know if this helps, bit on one of my centos 5 systems Apache (1, not 2) the logs are owned by root (and group root as well).


Top
   
 Post subject: Still nothing
PostPosted: Wed Jun 01, 2011 7:07 pm 
Offline
Senior Newbie

Joined: Sat May 28, 2011 11:12 pm
Posts: 13
@haus:Tried changing back to root, but no luck. Thanks anyway.

I am running out of ideas. My next step will be to rebuild the box and start from scratch.

If that doesn't work, I don't know what will.


Top
   
 Post subject: SUCCESS!
PostPosted: Wed Jun 01, 2011 8:08 pm 
Offline
Senior Newbie

Joined: Sat May 28, 2011 11:12 pm
Posts: 13
So after I backed up my files to another partition, deleted the current CentOS partition and created another, then reconfigured it as per the LAMP instructions linked earlier, I finally have an "OK" instead of "FAILED"!

In rebuilding, I remembered two other things I did to the old install:
1. Install and remove squid, and
2. remove the squid user.

Apparently they don't coexist very well.

Regardless, thank you obs, otherbbs and haus for your help and patience!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group