Category Archives: LAMP Server Setup

LAMP Server Maintenance

Optimize tables overnight Graphs with free memory everyday (with gnuplot and/or Ganglia) clever report of the most frequent Apache errors Cronjob to check Apache and MySQL are up, otherwise start them Cronjob to check the space left Make sure you … Continue reading

Posted in LAMP Server Setup, System Maintenance | Leave a comment

APC – Installing It On CentOS

yum install php-pear yum install php-devel yum install httpd-devel Edit the file /usr/share/pear/pearcmd.php and add the following at the beginning: @ini_set(‘memory_limit’, ’16M’); otherwise you’ll probably get a fatal error whilst building the extension: pecl install apc Now configure PHP to … Continue reading

Posted in LAMP Server Setup, Linux, Web Development | Leave a comment

Linux – Check Apache and MySQL Are Running, Otherwise Start Them

The file is also reachable through this link: lamp-guarddog #!/bin/sh # Check whether Apache or/and Mysql server are down. If so, it starts them. SERVICE_HTTP=’/usr/sbin/httpd’ SERVICE_MYSQL=’/usr/libexec/mysqld’ ADMIN_EMAIL=’danieleocchipinti.it@gmail.com’ if ps ax | grep -v grep | grep $SERVICE_HTTP > /dev/null then … Continue reading

Posted in LAMP Server Setup | Leave a comment

Fast LAMP Server – Debian Lenny

apt-get install apache2 php5 libapache2-mod-php5 apt-get install php5-xsl php5-gd php5-cli apt-get install mysql-server mysql-client php5-mysql In order to enable the use of .htaccess, you need to edit this file: /etc/apache2/sites-available/default In the section <Directory /var/www/>, change to: AllowOverride all In … Continue reading

Posted in Debian / Ubuntu / Kubuntu, LAMP Server Setup | Leave a comment

Secure PHP & Apache Configuration

PHP Disable error messages expose_php Off Check you can’t get info by doing telnet localhost 80 and then issueing: HEAD / HTTP/1.0 session.use_only_cookies = 1 allow_url_fopen Off [if you don’t really need the opposite] register_globals = Off magic_quotes_gpc = ??? … Continue reading

Posted in Apache, LAMP Server Setup, PHP, Security, Web Dev Security | Tagged | Leave a comment

LAMP on Ubuntu

apt-get install apache2 apt-get install php5 libapache2-mod-php5 apt-get install php5-xsl php5-gd /etc/init.d/apache2 restart apt-get install mysql-server apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin apt-get install bind9 apt-get install php5-cli ln -s /etc/apache2/mods-available/vhost_alias.load /etc/apache2/mods-enabled/vhost_alias.load ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

Posted in Debian / Ubuntu / Kubuntu, LAMP Server Setup | Leave a comment

Server Setup and LAMP Setup From Scratch with full UTF support (utf8)

Set the clock date MMDDhhmmYYYY hwclock –systohc & Where: M=month, D=day, h=hour, m=minute, Y=year The latter command is essential: it copies the date into the BIOS and makes the change definitive First steps * echo “hostname_you_chose” > /etc/hostname /bin/hostname -F … Continue reading

Posted in LAMP Server Setup, Security, Web Dev Security | Tagged , | Leave a comment

LAMP Backup Script

#!/bin/bash # # my_backup.sh V1.0 # # An useful script that performs a variety of operations in order to backup different data. # It’s a good starting point for your bespoke one # Creating all the definitions datestamp=$(date +’%Y%m%d%H%M%S’) tarname=my_backup-$datestamp”.tgz” … Continue reading

Posted in LAMP Server Setup, System Maintenance | Leave a comment

SELinux

A good resource is: http://www.crypt.gen.nz/selinux/faq.html There, the most important thing is this. It is important that server daemons are started within the correct context, if they are not then they will probably not run properly. For Fedora and RedHat Enterprise … Continue reading

Posted in LAMP Server Setup, Redhat / CentOS, Security | Leave a comment

Server: Setting a Firewall With Iptables

Copy the file iptables.sh in the directory /etc/init.d with these rules (but obviously you need to customize them). Make the file executable. Assuming the current run level is the second one:ln -s /etc/init.d/iptables.sh /etc/rc2.d/S97iptables Actually you should link the script … Continue reading

Posted in LAMP Server Setup, Linux, Security, System Maintenance, Web Dev Security | Leave a comment