LAMP Server
Original posted by: Admin on 26-02-2007
When building a new website or updating an old site its important to have a development area where you can do all your testing before the site goes live. Some people choose to do this on their webserver under a different folder or subdomain, others use a local machine make their updates.
I personally prefer to use a local machine as they don't require you to constantly upload file and refresh internet content which can be slow and painful.
Recently I built a home server using Ubuntu 6.10 which has worked great and saved me a lot of time and effort, considering it only took me an hour to full setup.
From windows I can access this machine, via an SSH client, or via my windows network drive. Its a great place to develop websites before they go live.
Install Ubuntu - LAMP Server
Create a root password
sudo passwd root
Update a config file so all updates can be downloaded, uncomment everything (# is a comment)
sudo nano -w /etc/apt/sources.list
Install Updates
sudo apt-get update
Install SSH Server
sudo apt-get install openssh-server
The machine can now be connected to via an
SSH client.
If you are unsure of the servers IP address type
ifconfig and it will be printed.
Now we'll install the next section.
Install Samba
sudo apt-get install samba
Stop Samba, we need to configure it.
sudo /etc/init.d/samba stop
Lets create a backup of the config file incase something goes wrong
sudo mv /ect/samba/smb.conf /etc/samba/smb.conf_backup
Clear out the config file
sudo touch /etc/samba/smb.conf
Open the config file
sudo nano -w /etc/samba/smb.conf
Copy and Paste this config file
[global]
; General server settings
netbios name = YOUR_HOSTNAME
server string =
workgroup = YOUR_WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
passdb backend = tdbsam
security = user
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast
wins support = yes
printing = CUPS
printcap name = CUPS
syslog = 1
syslog only = yes
; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/
; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no
; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no
; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[print$]
path = /var/lib/samba/printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0664
directory mask = 0775
[printers]
path = /tmp
printable = yes
guest ok = yes
browseable = no
; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes
[MyFiles]
path = /var/www
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
You will need to update a few things, such as your username and usergroup.
Now we want to make the default sharing drive the same as the apache www directory so we can store our web file on the machine.
sudo chmod 0777 /var/www
Start Samba
sudo /etc/init.d/samba start
Lets create a username and password for the samba account so that it can be used correctly
sudo smbpasswd -L -a choose_a_username
sudo smbpasswd -L -e choose_a_password
Your machine is now ready to be used as a LAMP server... But is your windows machine ready to access it?
We need to enable 'Wins Support'.
Click: Start > Control Panel > Network Connections
Find your default network connection, right click it and choose properties.
Select: TCP/IP
Click: Properties
Click: Advanced
Click: WINS
Click: Add
Type the IP Address of your Ubuntu LAMP sever
Click: Add
Select: Use NetBIOS over TCP/IP
Click: Ok (x3)
Reset Windows
Your windows is now setup to access your lamp server, you can choose to acccess it via network connections, or a much easier way is via a network drive which you can setup in 'My Computer'
Click: Start
Right-Click: My Computer
Select: Map Network Drive
Type: 192.168.XXX.XXX/MyFiles (Ubuntu IP Address)
Click: Finish
You should now have a development Lamp sever which you can use to build all your new projects, or update existing ones!