How to: Complete Ubuntu server (Lighttpd, MySQL, PHP5, mail)

Hi,

I wrote a guide about setting up an Ubuntu linux server from the beginning, with:

  • Lighttpd, PHP5 and MySQL,

  • Google apps for domain e-mail, and PHP(mail) working,

  • IPTables firewall and securing SSH access,

  • Some basic optimization things like etags

There also some basic tips about how to use 'free -m', how to keep everything up to date and how to define aliases.

The tutorial is located on my blog:

http://nanotux.com/blog/the-ultimate-server/

(no ads at all on the site, I made the contents clickable, so you can go to a topic directly)

Hope you guys like the guide!

3 Replies

Does the msmtp work with the Google App usernames? Currently, I'm doing some funky gmail forwarding with default reply-from's as the GA username. It works, it is just crazy.

@freedomischaos:

Does the msmtp work with the Google App usernames? Currently, I'm doing some funky gmail forwarding with default reply-from's as the GA username. It works, it is just crazy.

I just use the default name as my from address, so don't know if the following is going to work, but it's worth a try.

Maybe you can add a user in GA, and then fill in his username and password in the msmtp configuration. It doesn't sound very special, but atm I don't see why it wouldn't work.

I mean this configuration

> account default

host smtp.gmail.com

port 587

timeout 30

auth on

user ACCOUNT@DOMAIN.com

password PASSWORD

auto_from off

from ACCOUNT@DOMAIN.com

maildomain DOMAIN.com

tls on

tls_starttls on

tlstrustfile /home/ntux/etc/.certs/ThawtePremiumServerCA.crt

(leave account default as it is there, only change the uppercase things) on

http://nanotux.com/blog/the-ultimate-server/4/#l-mail

This is great work, but I've been running into issues with your write-up. I tried posting them to your blog, but I'm not sure if they are in moderator limbo or what. So, for other users:

In the section on vhosts, I found that I needed to chown the log folder in order to restart lighttpd:

chown www-data:www-data ~/public_html/logs/*

Also if you plan to set-up hosting for friends on your server or you want to run Wordpress, take a look here:

http://www.pureroon.co.uk/2009/02/05/ho … wordpress/">http://www.pureroon.co.uk/2009/02/05/how-to-get-ubuntu-804-server-running-lighttpd-ready-for-the-mighty-wordpress/

In the section on iptables, the easyfwgen site that is recommended to generate rules does not work in Ubuntu – they were written for Red Hat. I'm sure modifying them for Ubuntu is trivial, but I was not able to get those rules to work, so I used the basic rules provided here:

http://www.iheartlinux.com/2008/12/02/b … iguration/">http://www.iheartlinux.com/2008/12/02/basic-iptables-configuration/

In addition, the line to save your rules:

sudo iptables-save > /etc/iptables.up.rules

will not work. Instead, use:

sudo sh -c "iptables-save > /etc/iptables.up.rules"

Thanks for the great tutorial!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct