Frequently I am asked by clients for details on how to manage a lampp server. While I do not recommend that clients who are not familiar with systems mess with the core system there are a few simple tasks that anyone can do to back or restart basic systems.
Let’s get started. First you need an account with SUDO access to the server. By SUDO you are going to SSH into the server.
SSH? SUDO?
Linux servers typically do not have a windows type interface to them and require that you to everything in a command line system. SSH is how we are going to connect to the server. To do this you need a terminal program, OSX on the Mac includes one out of the box. Windows users will need to go and download a program like putty.
SUDO references to an account with administrative privileges.
Connecting to the server
Your hosting company or administrator should be able to provide you with an IP or web site name (www.url.com) that you can connect to. Open the terminal and put it in like this:
SSH username@providediporurl
If the administrator has a special port – then put it at the end. For example if it was port 2222:
SSH username@providediporurl -p2222
Once you hit enter on your keyboard you should be prompted for a password. Type in the provided password and you will gain access to the server’s terminal systems.
If everything worked correctly you should see:
username@providediporurl :~#
First step is to switch over to the root account – this is where you need to be careful. Root account access can easily break or blow up a server.
In the terminal type:
sudo -s
You will see a prompt to enter your password, type it in and hit enter. You will see the prompt change to:
root@providediporurl :~#
Success! You now are the super user for this system.
Simple tasks you can do
Show directories
ls -la
Change directories
cd /tmp/
Move files
mv SOURCE TARGET
mv filename.ext /tmp/filename.ext
Copy files
cp SOURCE TARGET
cp filename.ext /tmp/filename.ext
MySQLDump the database
Using the built in mysqldump command you can export the entire database into a single file for easy backups. The command is setup like this, note: you’ll need your database name, user and password.
mysqldump -u username -p database_name > dump.sql
This will create a file called dump.sql in the current directory you are in.
Restart Apache
apache2ctl restart
In closing…
This is just a very brief walk through of the command line. There are many people, like me, who can help you to work with a server. A professional linux administrator is going to be able to do this and much more with ease. If anyone thinks there are more simple task I should add to this blog post, please leave it in the comments below.
Discover more from AJB Blog
Subscribe to get the latest posts sent to your email.