How to: Complete Ubuntu server (Lighttpd, MySQL, PHP5, mail)
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
@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
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:
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:
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!