Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Saturday, August 9, 2014

Fun with SELinux

I installed Xymon on a webserver, and I was having a lot more issues than I thought I would.  I had installed Xymon before, but halfway through I realized that the VM I installed it on before must have been Debian, and I probably just used the .deb packages.  As it turns out, the problems I was having weren't related to CentOS, but SELinux.  I kept getting 403 forbidden errors, which were ultimately permission issues. Eventually I found the solution on the CentOS forums:

# semanage fcontext -a -t public_content_rw_t '/home/user(/.*)?'
# restorecon -R /home/user



Now that I think of it, I had problems with Apache reading a .conf file that I linked to from user directory, so that was probably the same issue.

Thursday, October 15, 2009

Progress

I've had a project in mind for probably more than a year now. It involves programmatically scraping web pages for information and then saving that information to a database. I decided to use Python as the programming language, and MySQL as the database. Somewhere along the line I also decided to create a web front end, so Apache is also involved. I'd written some Python code a couple of months ago, then downloaded MySQL a month ago. Today I spent some time trying to get the pieces to work together and I had some modest success. I'm happy with that.

Monday, October 12, 2009

Path to python in Apache

One of my side projects has been developing a MySQL database that gets fed data from the web using Python, with a web front end. Since Python is feeding MySQL, I figured I'd use it as the server-side scripting language too, but from the beginning I've had problems. I kept coming up with the dreaded 500 Internal Server Error. After I'd restarted Apache all was well. I'd seen that in the httpd-error.log the error was 'Premature end of script headers', but for some reason today I noticed that wasn't the only error. The previous error always comes with "env: python: No such file or directory". That gives me something to go on. So it seems that Apache doesn't know the path to python. I saw something somewhere on the web about the path not being complete when apache was started, but I didn't see a fix--maybe just complete the path before starting Apache, eh? Anyway, I don't feel like running this to ground tonight--I'm bushed.