Needs some help with ubuntu slice

Discussion in 'Site & Server Administration' started by clickngo, Mar 14, 2007.

Thread Status:
Not open for further replies.
  1. #1
    Hi,

    I need help installing software on my ubuntu slice.

    I need to install apache2, php and mysql.

    Also, if possible, postfix, dovecot and squirrelmail.

    Can someone please guide me through installing these securely?

    There are many tutorials, but none provide a universal step by step guide, all are shortcuts to getting things going without considering security.

    Help is appreciated

    Cheers
     
    clickngo, Mar 14, 2007 IP
  2. clickngo

    clickngo Peon

    Messages:
    251
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I am concerned how secure the various tutorials on installing stuff on your ubuntu distribution really are.

    Here is what I have done so far:

    # make sure that dapper universe is not commented in source.list
    # and make sure the ubuntu dapper is up to date
    sudo perl -pi -e 's/#\s?(.*dapper universe$)/\1/g' /etc/apt/sources.list
    sudo apt-get update && sudo apt-get upgrade

    # install mysql
    apt-get install mysql-server mysql-client libmysqlclient12-dev

    # edit /etc/mysql/my.cnf and comment out the line bind-address = 127.0.0.1:
    # then restart mysql
    /etc/init.d/mysql restart

    # then change root password
    $ mysql -u root
    mysql> UPDATE mysql.user SET Password=PASSWORD ('your_root_mysql_password') WHERE User = 'root';
    mysql> FLUSH PRIVILEGES;
    mysql> quit

    # install apache2
    apt-get install apache2 apache2-common apache2-doc apache2-mpm-prefork apache2-utils libapr0 libexpat1 ssl-cert

    # install php
    apt-get install autoconf automake1.4 autotools-dev libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php-pear php5-ldap php5-mhash php5-mysql php5-mysqli php5-snmp php5-sqlite php5-xmlrpc php5-xsl php5-imap php5-mcrypt php5-pspell

    # edit apache2.conf
    nano /etc/apache2/apache2.conf

    # change DirectoryIndex to
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

    # enable apache modules
    a2enmod ssl
    a2enmod rewrite
    a2enmod suexec
    a2enmod include

    # reload apache config
    /etc/init.d/apache2 force-reload

    I then make sure my domain is setup with apache at the following places:
    /var/www/my_domain.com
    /var/log/apache2/my_domain.com
    /etc/apache2/sites-available/my_domain.com

    my_domain.com virtual host file contains the following:

    <VirtualHost *>
    ServerName www.my_domain.com
    ServerAlias my_domain.com
    DocumentRoot /var/www/my_domain.com

    CustomLog /var/log/apache2/my_domain.com/access.log combined
    ErrorLog /var/log/apache2/my_domain.com/error.log

    <Directory "/var/www/my_domain.com">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>

    </VirtualHost>

    #simlink my new domain to sites-enabled directory
    ln -s /etc/apache2/sites-available/my_domain.com /etc/apache2/sites-enabled/my_domain.com

    # edit Apache’s configuration file to tell it my IP address:
    vi /etc/apache2/apache2.conf
    # paste this before the # Include the virtual host configurations: line (it’s one before the last):
    ServerName my.slice.ip.address

    # edit Apache’s log rotation to include my new domain:
    vi /etc/logrotate.d/apache2

    # paste this at the end:

    /var/log/apache2/my_domain.com/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 640 root adm
    sharedscripts
    postrotate
    if [ -f /var/run/apache2.pid ]; then
    /etc/init.d/apache2 restart > /dev/null
    fi
    endscript
    }

    I am stuck on what to do next to finish my installation.

    Can someone please take the time to check the above detail and also let me know what else I need to know?

    I have tried various links and tutorials, but all lack detail.
     
    clickngo, Mar 14, 2007 IP
Thread Status:
Not open for further replies.