READ FIRST - Linux Introduction
This article explains a few basic need-to-know points for using Linux as your web server OS. This article is more oriented towards those who are new to Linux and don't know much, if anything about it.
There's some substantial differences between using Linux and Windows, therefore the reason for my writing this article. While I won't go into great detail explaining how to use Linux, I do intend on explaining how to use your Linux web server and understand the differences you'll need to know and be faced with compared to using Windows.
PERMISSIONS
THE SUDO COMMAND
Permissions are probably one of the most frustrating things about Linux for Window's users, or at least it was for me. Many things you do in Linux will require "root" permissions, which is similar to the Administrator account in Windows. As far as I know, there isn't a way to always be logged in as root to overcome this challenge, so you will have to change to root permissions during some Terminal or Konsole sessions. The command to do something as root is the sudo command. Some distributions of Linux use a different command, but I know both Fedora and Ubuntu use sudo. One of my favorite finds is the sudo -s command, which will keep you locked with root permissions during a terminal session.
FOLDER PERMISSIONS
The other factor is folder permissions, especially from your root directory. If you try to go into your Apache settings through your file browser, then you're going to encounter permission problems when trying to alter any files there. The same goes for trying to access your htdocs folder using the same method. One of the problems comes with the fact Linux uses folder and file ownership. The easiest way I've found to work around this issue is by re-assigning ownership from root to your login account. This will give you the necessary access needed to atler and add files freely. For your htdocs folder, you can use an FTP client such as Filezilla to add your files and get past the pesky permissions issues.
HOW TO CHANGE FOLDER/FILE OWNERSHIP IN LINUX
You can change the file and folder ownership easily. Open your command window and use the following command to change the folder and subfolders ownership:
sudo chown -R steven:steven /opt/lampp/htdocs
change steven:steven to your username. You can change /opt/lampp/htdocs to whatever folder you're trying to access. Now you can right-click on the files and change the properties of them, similar to Windows. I recommend you reading more about this if you're having difficulties. There's several other variables to that command that are worth learning or at least looking at.
INSTALLING SOFTWARE
This particular subject may seem off-topic, but I can promise you you're going to need to know how to do this at some point. Unlike Windows, Linux doesn't use nice little .exe files to install software, as you may have noticed when you installed XAMPP. Some of the programs require you even compile them first and can get really tricky. But for most common applications, you can use the Package Installer. There's different names for this with different versions of Linux, but it's the easiest way to install software in Linux.
For Ubuntu, go to System > Administration > and click on Synaptic Package Manager. Enter the administrator or root password.
Here you can search for a particular program by category on the left side, or search all by selecting All on the left, then typing the program you're looking for in the Quick Search box. Once you find the program you're looking for, check the status of it according to the box color beside it. If it's empty or white, then the program isn't installed yet. If it's green, then it's already installed. To install the package or program, click on the box and select "Mark for Installation". If there's dependent packages, it will ask you if you want to install them as well. Once you've done that, click "Apply" at the top and it will install the program(s) you have selected.
To find the program, click on "Applications" and find the category it falls into and you should find the program.
For Fedora, go to Sytem Settings > Add and Remove Software. It's very similar to Ubuntu and works the same way.
Last Updated (Sunday, 15 February 2009 05:43)






