Saturday, January 15, 2011

Web Server

debconf-set-selections <<\EOF
mysql-server-5.0 mysql-server/root_password_again string terceS
mysql-server-5.0 mysql-server/root_password string terceS
EOF
 
# install web server
apt-get -y install apache2 php5 mysql-server php5-mysql php5-mcrypt php5-gd php5-curl php5-cli libapache2-mod-auth-mysql bzip2 wget
 
# configure apache modules
a2enmod auth_mysql
 
# install ssl
http://www.panticz.de/apache2_openssl_certificate
 
# enable url rewrite
a2enmod rewrite
sed -i '11s|AllowOverride None|AllowOverride all|g' /etc/apache2/sites-available/default
sed -i '12s|AllowOverride None|AllowOverride all|g' /etc/apache2/sites-enabled/default-ssl
 
# update memory limit for php
sed -i 's|memory_limit = 16M|memory_limit = 512M|g' /etc/php5/apache2/php.ini
sed -i 's|memory_limit = 32M|memory_limit = 512M|g' /etc/php5/cli/php.ini 
 
# set hostname
echo "192.168.1.88   $(hostname).example.com   $(hostname)" >> /etc/hosts
 
# restart apache
/etc/init.d/apache2 restart
 
# ToDo
# enable ssl: a2enmod ssl
# See /usr/share/doc/apache2.2-common/README.Debian.gz on how to configure SSL and create self-signed certificates.

No comments:

Post a Comment