The Perfect Server - OpenSUSE 11.1 [ISPConfig 3] - Page 4

Want to support HowtoForge? Become a subscriber!
 
Submitted by till (Contact Author) (Forums) on Thu, 2009-03-26 19:41. ::

8 Install Postfix, Courier, Saslauthd, MySQL

Run

yast2 -i postfix postfix-mysql mysql mysql-client courier-imap courier-authlib courier-authlib-mysql python cron cyrus-sasl cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapi cyrus-sasl-otp cyrus-sasl-plain cyrus-sasl-saslauthd libmysqlclient-devel pwgen

Start MySQL, Postfix, SASL and Courier and enable the services to be started at boot time.

chkconfig --add mysql
chkconfig --add postfix
chkconfig --add saslauthd
chkconfig --add fam
chkconfig --add courier-authdaemon
chkconfig --add courier-pop
chkconfig --add courier-imap
chkconfig --add courier-pop-ssl
chkconfig --add courier-imap-ssl
/etc/init.d/mysql start
/etc/init.d/postfix start
/etc/init.d/saslauthd start
/etc/init.d/courier-pop start
/etc/init.d/courier-imap start
/etc/init.d/courier-pop-ssl start
/etc/init.d/courier-imap-ssl start

Now I install some rpm packages which are not available from the openSUSE main repositorys.

cd /tmp
rpm -i http://download.opensuse.org/repositories/server:/mail/openSUSE_11.0/i586/getmail-4.7.6-1.4.i586.rpm
rpm --force -i http://download.opensuse.org/repositories/home:/atzewilms/openSUSE_11.1_Update/i586/maildrop-2.0.4-10.5.i586.rpm

Warnings like: "warning: getmail-4.7.6-1.4.i586.rpm: Header V3 DSA signature: NOKEY, key ID 367fe7fc" can be ignored.

Next I install the pam_mysql module from source. pam_mysql is not available from the main openSUSE repository and the package from the build service does not worked for me.

yast2 -i pam-devel
cd /tmp
wget http://heanet.dl.sourceforge.net/sourceforge/pam-mysql/pam_mysql-0.7RC1.tar.gz
tar xvfz pam_mysql-0.7RC1.tar.gz
cd pam_mysql-0.7RC1
./configure
make
make install
rm -rf /tmp/pam_mysql-0.7RC1
rm /tmp/pam_mysql-0.7RC1.tar.gz

To secure the MySQL installation, run:

mysql_secure_installation

Now you will be asked several questions:

server1:~ # mysql_secure_installation




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n]
 <-- Y
New password: <-- fill in your desired MySQL root password
Re-enter new password: <-- confirm that password
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
 <-- Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
 <-- Y
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
 <-- Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 <-- Y
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!


server1:~ #

Now your MySQL setup should be secured.

 

9 Amavisd-new, Spamassassin and Clamav

Install Amavisd-new, Spamassassin and Clamav antivirus. Run

yast2 -i amavisd-new clamav clamav-db zoo unzip unrar bzip2 unarj perl-DBD-mysql

To enable it, run:

chkconfig --add amavis
chkconfig --add clamd
/etc/init.d/amavis start
/etc/init.d/clamd start

 

10 Install the apache 2 Webserver and PHP5

Inastall apache2 and suphp. Run:

yast2 -i apache2 apache2-mod_fcgid

rpm -i http://download.opensuse.org/repositories/server:/php/server_database_apache_openSUSE_11.0/i586/suphp-0.6.2-10.41.i586.rpm

Install PHP5:

yast2 -i php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dbase php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-mysql php5-ncurses php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm ImageMagick curl apache2-mod_php5

Then run these commands to enable the apache modules:

a2enmod suexec
a2enmod rewrite
a2enmod ssl
a2enmod actions
a2enmod suphp
a2enmod fcgid
chown root:www /usr/sbin/suexec2
chmod 4755 /usr/sbin/suexec2

And start Apache.

chkconfig --add apache2
/etc/init.d/apache2 start

Installing phpMyAdmin:

rpm -i http://download.opensuse.org/repositories/server:/php:/applications/openSUSE_11.1/noarch/phpMyAdmin-3.1.2-1.1.noarch.rpm

Warnings like "warning: phpMyAdmin-3.1.2-1.1.src.rpm: Header V3 DSA signature: NOKEY, key ID 367fe7fc" can be ignored.

 

11 pure-ftpd

Install the pure-ftpd FTP daemon. Run:

yast2 -i pure-ftpd quota

chkconfig --add pure-ftpd
/etc/init.d/pure-ftpd start


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Cracklefish (not registered) on Sun, 2010-05-09 12:47.

The current version can be got from:

rpm -i http://download.opensuse.org/repositories/server:/php/server_database_apache_openSUSE_11.1/i586/suphp-0.7.1-3.26.i586.rpm

However, this requires php5-fastcgi before it will load so I ran the  next statement and installed the php modules then ran the suphp install.

Submitted by Cracklefish (not registered) on Sun, 2010-05-09 11:26.

There seems to be a problem with the version of Getmail-4.17.0 on the openSUSE site, whatever version of Python I have tried it still gives a "requires Python <2.6..." message so here is what I did:

cd /tmp

wget http://pyropus.ca/software/getmail/old-versions/getmail-4.17.0.tar.gz

tar xvfz getmail-4.17.0.tar.gz

cd getmail-4.17.0

python setup.py build

python setup.py install

This was using Python 2.7b1 which is the end of life V2 Release Candidate. Apparently they will support this for 5 years. I've not tried the V3 versions on offer (if it a'int broke...!)

 

Submitted by Anonymous (not registered) on Mon, 2009-09-28 19:11.
 rpm --force -i http://download.opensuse.org/repositories/home:/atzewilms/openSUSE_11.1_Update/i586/maildrop-2.1.0-3.2.i586.rpm
warning: /var/tmp/rpm-xfer.OCxYJZ: Header V3 DSA signature: NOKEY, key ID 6530cd38
error: Failed dependencies:
        libcourierauth.so is needed by maildrop-2.1.0-3.2.i586
        libfam.so.0 is needed by maildrop-2.1.0-3.2.i586
        libgcc_s.so.1 is needed by maildrop-2.1.0-3.2.i586
        libgcc_s.so.1(GCC_3.0) is needed by maildrop-2.1.0-3.2.i586
        libgdbm.so.3 is needed by maildrop-2.1.0-3.2.i586
        libpcre.so.0 is needed by maildrop-2.1.0-3.2.i586
        libstdc++.so.6 is needed by maildrop-2.1.0-3.2.i586
        libstdc++.so.6(CXXABI_1.3) is needed by maildrop-2.1.0-3.2.i586
        libstdc++.so.6(GLIBCXX_3.4) is needed by maildrop-2.1.0-3.2.i586
        libstdc++.so.6(GLIBCXX_3.4.9) is needed by maildrop-2.1.0-3.2.i586

Submitted by itsonlyme (not registered) on Fri, 2009-07-10 22:56.

and better still, instead of :

......
cd /tmp
wget http://heanet.dl.... etc

just use :

rpm -i http://download.opensuse.org/repositories/home:/buschmann23/openSUSE_11.1/i586/pam_mysql-0.7RC1-11.1.i586.rpm

Submitted by itsonlyme (not registered) on Fri, 2009-07-10 22:16.

and for pam-mysql-0-7RC1-tar-gz

I had to use

wget http://sourgeforge.net/projects/pam-mysql-0-7RC1-tar.gz

because that package has been moved

Submitted by itsonlyme (not registered) on Fri, 2009-07-10 21:52.

I used 

maildrop-2.1.0-3.2.i586.rpm

because I could't find your version, hope that's ok....

Submitted by Cracklefish (registered user) on Wed, 2009-04-15 10:55.

The version of phpMyAdmin in the openSUSE repo seems to have changed. The version there now is:

phpMyAdmin-3.1.3.1-1.1.noarch.rmp

 I ran

"rpm -i http://download.opensuse.org/repositories/server:/php:/applications/openSUSE_11.1/noarch/phpMyAdmin-3.1.3.1-1.1.noarch.rpm"

it seems to work!

Submitted by Anonymous (not registered) on Sun, 2009-05-24 14:45.
The current version is now 3.1.5.1-1.1
Submitted by itsonlyme (not registered) on Fri, 2009-07-10 23:53.
it's now version 3.2.0-1.1
Submitted by Wendy (not registered) on Wed, 2009-04-08 18:40.

You may need to change to root folder before doing mysql secure:
 cd /
mysql_secure_installation

Submitted by Anonymous (not registered) on Sun, 2009-03-29 18:22.

i ran into a problem when i was trying to run..

 "mysql_secure_installation"

 so i found this fix hopefully it helps you out.

 "echo 'export PATH=$PATH:/Applications/MAMP/Library/bin' >> ~/.bash_profile"