I've been given a task to understand why 2 CentOS web servers running apache 2.2.3 are experiencing very high loads on specific occasions.
The first thing I checked was /var/log/messages but then I realized that rsyslog is turned off for some reason, so I started it and turned it on using chkconfig.
Then, I wanted to check apache error and access logs, so I browsed to /var/log/httpd but found the folder to be empty.
I've checked /etc/httpd/conf/httpd.conf and saw these lines:

ErrorLog logs/error_log
CustomLog logs/access_log combined


As far as I know it refers to /var/log/httpd/ but as said before the folder is empty.
While writing this question I've looked for the httpd version on the server and ran httpd -v and that's the response I got:

[root@domU-IP httpd]# httpd -v
Server version: Apache/2.2.3
Server built:   May  4 2011 06:51:15
Unable to open logs


My questions are:

 1. What could cause the logs to disappear? (It is possible they were never created in the first place)
 2. How can I recreate the logs and make sure data is written to them?
 3. Which permissions should be set on `/var/log/httpd`? (current permissions are: drwx------ 2 root root)


Thanks in advance


Question: php regular expession convert to python code
Answer: Working version .. display all images from a given web site using tag IMG src >
code:

  import re
  import urllib
  print "Start"
  url="http://www.deviantart.com"
  data=urllib.urlopen(url)
  out=data.read()
  print 
  title_regex = "/&lt;title&gt;(.+)&lt;\/title&gt;/i"
  m = re.search("&lt;title&gt;(.+)&lt;\/title&gt;", out)
  print "first",m
  print "grop",m.group(1)

  title_regex = "/&lt;title&gt;(.+)&lt;\/title&gt;/i"

  pics = re.compile(r"&lt;IMG[^&gt;]*src=([^&gt;]*[^/])")#Change IMG tag 
  allpics=pics.findall(out)
  print "found",pics
  for mypic in allpics:
     print "&lt; IMG src=",mypic


thanks all