RegisterRegister 
 
Basic Red Hat Linux Server Guide

 
Post new topic   Reply to topic    Absolute Insight Forum Index -> Articles

Impact Reply with quote
Site Admin


Joined: 01 May 2004
Posts: 3257
Location: Pinecrest, FL

PostPosted: Tue Jun 15, 2004 3:14 pm    Post subject: Basic Red Hat Linux Server Guide
 
Linux: For all of you out there who have always wanted to try it out, I'm here to give you a place to start.

Linux is an operating system. What sets Linux apart from other operating systems like Microsoft Windows, and MacOS is the fact that it is Open-Source. Open-Source means that the source code is publicly available for anyone to look at and edit. It is a fully customizable, very powerful, command-line based operating system. Because Linux is open-source, many people have added their own twist to it, and due to this, there are many different versions. Some of the more popular versions are: Red Hat Linux, Mandrake Linux, Fedora Core (based on Red Hat), Debian, and Gentoo Linux. I was planning on using Mandrake Linux for my tutorial, but due to a problem with my graphics card I switched to Red Hat.

The first step of the journey into the Linux world is to decide what version to use, and then to find a copy of that version. The website www.linuxiso.org has quite a few versions. It has both Mandrake and Red Hat as well as a handful of others.

Red Hat is the way to go for new users. Mandrake is another good choice, it has a GUI, but for this guide I will be using RedHat. If you are used to a GUI (Graphical User Interface) such as Windows or MacOS, you will feel right at home with the Red Hat installer.
Edited: Very sorry about saying Mandrake's Installer was "all text based". I must have hit a wrong key. I have tried reinstalling Mandrake and there is a GUI installer. Sorry for any confusion this may have caused.

During installation it asks the user to select the components he/she wishes to use with the operating system. There are many built-in abilities for Linux. The most important for me was the ability to set up FTP, HTTP, and mail servers. While you can select them to be installed in the installation, I chose not to. While it would be nice having the servers set up as soon as we booted into Linux, I was planning on getting the newest version of each server program. Sometimes things can get a bit muddy when you install new packages over the previously installed versions. Also during the installation it prompts for two users, the "root" user and a personal user. The root user access is for the administrator and the root password is needed to edit settings for most system related issues.

If you are worried about Linux being "Command-Line" based, fear not. Most current versions of Linux include a user GUI. This allows Linux to be used like any other, perhaps more familiar, operating system. Users can point, click, and run programs in Red Hat Linux just like Windows or MacOS. A few other features like a graphical web browser (similar to Internet Explorer, Netscape, or Opera), a text-based web browser, text editors, developement tools (programming), and games are also available options to select during installation.

Note: Make sure to install the developer packages (these are used to compile source scripts). Without them you won't be able to install some programs down the road.

I decided to install all three desktops (KDE, X Window, and GNOME), system tools, development tools, games, and graphics programs. If you plan to follow this guide to make a Linux Server, make sure to install the system tools, server administrator tools, and the development tools.

The rest of this article will be a guide to configuring an operating system that will eventually turn into a server. By the end of the article I (and you too!) will have a server computer that is capable of running Apache, PHP, MySQL, Perl, FTP server, and File Server (internal network). Expect to see a lot of screen shots, a lot of common problems, and many solutions.

Depending on your selection of Server components at the install prompt, your journey through Red Hat may differ slightly from mine. For example: If you installed the MySQL Server through Red Hat, you will do things in the same order as I do. If you didn't install the MySQL server, you will get an error message when trying to compile PHP with MySQL. To solve this issue, skip ahead to the MySQL section, install MySQL and then go back and finish installing PHP.

Lets get started!
[page]
Upon entering Linux (Linux from now on will always refer to Red Hat 9.0) the user is prompted with a user-login. This is nothing new, nor anything special. If you are not editting the system configuration it would make sense to login as the personal user. However, since changing the system settings is required to configure the operating system so that it can eventually act as a server, start by logging in as the root user.

After a quick login, a main Linux desktop will appear. There are three main components that map out a brief overview of the desktop: "Root's Home", "Start Here", and "Trash".

  • "Root's Home" is a link to the folder "/root" pronounced "slash root". This is the root directory which contains some system files. A brief overview of folders will be covered a bit later. When logged in on a different user (non-root) your "(user_name) home," where (user_name) is the name of the logged in user and it points to "/home/(user_name)/". "/home/(user_name)", is like the My Documents folder in Windows. It holds the personal files for each user.
  • "Start Here" contains an applications folder and lists the programs that are currently installed on your computer, while offering a way to launch each by double-clicking on them. It also has system settings and preferences. More on each of these will follow shortly.
  • "Trash" is just like it sounds; it is almost identical to the "Recycle Bin" or "Trash Can" in other operating systems. Deleted files are moved here so you can look at them one last time before permanently deleting them.

There is also a bar along the bottom of the screen. The bar has a Red Hat in one corner, a few icons, a rectangular little window icon (with four pieces, one of them selected), a large blank space, and a clock.

  • "Red Hat" is very comparable to the Start Menu, in both position and function. It provides access to installed programs, system settings, a file search, and user tasks (switching users, restarting, and shutting down).

The icons will vary depending on the selected install options. They may include programs such as:

  • Mozilla Browser: A graphical web-browser that is very comparable to Netscape.
  • Evolution Email: An email client.
  • OpenOffice.org Writer: A word processor for typing (comparable to Microsoft Word).
  • OpenOffice.org Impress: A presentation creator that looks to be somewhat like Microsoft PowerPoint.
  • OpenOffice.org Calc Spreadsheet: Obviously a spreadsheet program that is probably much like Lotus123 or Excel.
  • Print Manager: Monitor and setup for printers.
  • Workspace Switcher (that rectangular window icon): Upon first login the upper left corner is selected. By selecting the other three pieces you can switch between workspaces. If you open a folder or a browser (or pretty much anything) in one of them and switch to another workspace all of the open items disappear. They are left behind in the old workspace. You are free to go back and find them how they were when you left them by simply clicking on the workspace they are in. This allows you to have multiple desktops to fill with whatever you want. It is much like having multiple monitors that you can switch between, but only one can be viewed at a time. You can also to drag an application from one workspace to another (just click and drag). This is probably something you will need to spend a few minutes to play with and practice.
  • Blank space: Any time a program is run, it is added to the blank space. You can switch between open programs by clicking each (very similar to Windows).


Quote:
This is what I saw when I first logged in as Impact. This is the standard desktop.

[page]

Since this computer will eventually be used for a server, I need to install some programs. The first of which will be a web-server running Apache2 and PHP. The only way to get a copy of PHP is to download it from php.net and install it, same with apache2 from apache.org. This involves opening Mozilla (the web browser) and downloading from php.net and apache.org respectively.

If you have ever used a web browser, you should be able to navigate Mozilla without a problem; therefore, downloading PHP was easy.
Quote:
Mozilla, the built-in Web Browser is very easy to use and navigate.

After decompressing the download (tar.gz) found in my /root folder (where I chose to download it), I ran into a slight problem. In Linux there are no "Install" Icons. In Windows (my main operating system till recently) there have always been "Install" icons. You would click these, and the program would install itself on your computer, make a nice icon on the desktop for you, and add entries to your Start menu. In Linux this is not the case. Almost everything in the PHP folder is a script. This left me a slight bit baffled at first. I didn’t know what language they were in, or more importantly, how to run them.

To install a program that is in all source files (I will be using PHP and Apache2 in my examples) it requires the use of Linux's "Terminal". The Terminal is somewhat like a DOS (text-based) prompt. It is a command line used for issuing commands to the system. You can find it by going to RedHat --> System Tools --> Terminal. When the Terminal loads you will see a prompt. The idea is to navigate to the folder that contains the install files. The command 'ls' (LS in lowercase) can be used to list the files and folders in a directory, 'cd xxxxx' to change directories, and 'cd ..' to go up a directory.

The first step is to install Apache2. To get into the Apache2 directory you need to type 'cd httpd-2.0.49' assuming you unzipped the Apache2 folder into your root directory. Once in the directory you normally use the command './configure'. This will configure the installation, you can set flags to the end of the line to change options. In our case we need to install Apache2 with support for DSO modules (makes it easier to implement PHP). To do this, we need to use the command './configure --enable-so'. You should see the Terminal start running the configure script. When its complete you will be back at the prompt, and be ready to run your next command. The next command on the list is 'make'. By typing 'make' you will tell Linux to compile all of the source documents. When it's complete, all you will need to do is type 'make install' and it will finish installing Apache2.

Once Apache2 is finished installing, you will need to install PHP as a module of Apache2 (so they work together). To do this, just follow the same steps as above (but with different flags on './configure'). In my case I wanted to navigate to '/root/php-4.3.7/'. I did this by first going up a directory (from /root/httpd-2.0.49 to /root/). To go up a directory type 'cd ..'. Once in the /root directory I moved to the PHP folder: 'cd php-4.3.7'. You could have done this in one step by typing 'cd /root/php-4.3.7' from the Apache directory. After reaching the PHP folder the next thing was to build the source code and install the program. To install, we use the same method as before (same 3 steps), but with different flags on './configure'. In this case, run:
'./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql'
To explain this command:
./configure = Run the configure script in the current directory
--with-apxs2=/usr/local/apache2/bin/apxs = Configure with Apxs2 (Apache2) and let PHP know where apxs is. (This is the default directory for Apache2, we didn't change any variables for where it was installed to, so we pass ./configure the default path).
--with-mysql = This tells PHP to compile with support for MySQL (our database server) which will be installed later.

After running the configure script, the command 'make' compiled the source documents in the folder. The last of the three commands, 'make install', installs the program to the default program directory (the default directory is normally '/usr/bin').

After installing apache and php, copy the php.ini-dist file into the following directory: /usr/local/lib/php.ini
If you are still at the command prompt, you can easily do this by typing:
'cp php.ini-dist /usr/local/lib/php.ini'

Note: If you have any questions or problems, your best bet is to check http://us4.php.net/install.apache2. (If you are still having problems, please check my note on the next page about httpd.conf scripts).

You have now installed your first two applications in Linux (and they are built on each other as well). To see what options were available for each command during the installation process, type '(command) -h'. The '-h' stands for help, and will show a list of available flags that can be used for a given command.
[page]
Currently there is PHP and Apache2 installed. It is now time to configure Apache2 and PHP, collect requests from the generic HTTP port (80) and run .php files as PHP scripts.

Configuring Apache is very simple. Run the HTTP Server Config. Program: Red Hat --> System Settings --> Server Settings --> HTTP Server. If you don't see the Server Settings folder, chances are you didn't select it when you installed Red Hat. You can add more packages by going to Red Hat --> System Settings --> Add/Remove Applications. A configuration box is available to allow users to edit most of the aspects and settings of Apache.

Quote:
The Apache Server Configuration Panel is very easy to use. The Apache server can be customized here.

The following is a brief overview of some of Apache’s main settings:
Under Virtual Hosts --> Edit the host name can be edited and the root directory can be set for all incoming requests to the server. Creating multiple Virtual Hosts can be used to send people to different directories based on either a domain name or the incoming port. This could be useful for managing multiple domains while hosting them all on the same computer. Requests from absoluteinsight.net could go to /var/www/html/ai/ and requests from example.com could go to /var/www/html/example/. All of this is easily configurable through the Apache Configuration Panel. If at any time you need help, there is a button at the bottom of each page. The help menu is quite detailed and a good resource.
The Performance Tuning tab of the Apache Configuration Panel has options for things such as maximum number of connections, connection timeouts, and maximum number of requests per connection.

Quote:
Performance and Tuning settings for Apache: Change the number of connections, timeouts, and persistent connections.

Each Virtual Host has its own settings for error pages, directory pages, and much more. In my configuration panel 'index.php' was already listed as a valid directory page. This confirmed that the PHP installation was successful.

Quote:
Virtual Hosts allow you to run multiple sites from one Apache Server. You can have Apache use different paths/settings for each site depending on incoming port number, or domain name.


Quote:
More details of each virtual host: change error pages and default index page.

Apache recognizes the extension .php as a PHP file and will parse it correctly (hopefully). For information about having PHP parse .php3 pages as PHP or other extensions, please visit php.net.

You will need to add two additional lines to your httpd.conf file for Apache to know exactly what to do with .php files. This gave me quite a few problems. When installing php, it automatically adds the lines you need to a httpd.conf file, but apparently not the correct one. In my case, it added the lines to /usr/local/apache2/conf/httpd.conf. But for some reason my Apache config was running the httpd.conf file in /etc/httpd/conf/httpd.conf. Depending on which gets run on your system, you will have to add the following lines to the appropriate httpd.conf:
AddType application/x-httpd-php .php
LoadModule php4_module /usr/local/apache2/modules/libphp4.so

If you are using the httpd.conf file in /usr/local/apache2/conf/ then you will only need to use 'LoadModule php4_module modules/libphp4.so' as the second line (Apache knows that it is in the root directory).

Now it is time to test out the Apache configuration and make sure that it accepts incoming requests and displays the page correctly. To test Apache, a very basic HTML document can be created and saved in the /var/www/html/ folder (an example HTTP server directory). After creating the HTML document, attempt to connect to the server from another computer. To create the HTML document: Launch OpenOffice.org's Writer (on your bottom task bar). Once in OpenOffice, go to New --> HTML Document. Make a basic HTML document (anything you want) and save it to your HTTP server directory. I saved my file (which was just 'Hello World') as index.html in /var/www/html. Note that Apache is installed with Red Hat 9.0, but it doesn't start on boot. To start the Apache Server, navigate your Terminal to ‘/usr/sbin’, and run the command: 'apachectl start'
This should start your Apache Server. To stop the server, use 'apachectl stop'.

Quote:
An example of how to run apachectl. I ran each command twice to show that the command did something.

To test it the server, I switched to another computer and fired up my web browser and navigated to my server. This step may vary depending on your network. If behind a router, you will most likely need to configure the router to 'port forward' to will allow the router to pass requests from different ports to different places. The HTTP port (80) must go to your server's internal IP. More information about port forwarding can be found in the router manual or on the manufacturer’s website.

Note: If you get an error regarding line 252 in httpd.conf, make sure your Server Name (in the apache configuration panel) is one word.
If you are still not able to see your server over the network, please check to make sure there are ports opened in the server's firewall. To do this, Red Hat --> System Settings --> Security Level. Allow incoming connections for WWW (HTTP).

Quote:
The built in firewall allows you to open certain ports, or accept incoming connections from certain devices. This is useful if one connection is to an external internet, and one device to a LAN.


It may be useful to have Linux start the Apache Server when it boots up. This will allow the server to be restarted without having to manually start Apache each time.
To accomplish this task navigate to /etc/ in Red Hat and open a file called ‘rc.local’ with gedit (or any other text editor). Then, add the line '/usr/sbin/apachectl start' at the end of the file.

This file is run once the main initialization is complete. Now rc.local runs the command 'apachectl start' in the folder '/usr/sbin/'. This is the same command that was used to start the server. Since the script runs when the computer boots into Red Hat, Apache will now start at boot.

Quote:
Open the rc.local file to add commands to your Linux Boot.


Quote:
What my rc.local file looks like after adding the apachectl command.


Note: If your server is going to be accessed by external sources, you will need to open ports in the firewall to access the server. To open access to a certain port:
- RedHat --> System Settings -->Security Level.
- Edit the firewall to allow incoming connections either by device, or by port (service).
[page]
The next item on the to-do list was MySQL. MySQL is a database system used for storing data. PHP and MySQL work together very well. PHP is easily able to store, modify, and retrieve data from a MySQL database.

Open Mozilla and go to www.mysql.com to download a Linux RPM of MySQL. An RPM is a precompiled install program for use in Linux. When using an RPM, you won't need to use the commands covered earlier.

In Red Hat 9 an early version (3.23.x) is included. If you installed it, you will probably want to upgrade. Upgrading can be a bit more difficult. If you navigate your Terminal to your RPM (in my case /root/), and try to install it: 'rpm -Uvh MySQL-server-4.20.0-0.i386.rpm' (this was the version number for me, your version may differ), errors that look something like this may occur:
error: Failed dependencies:
libmysqlclient.so.10 is needed by (installed) xxxxxxxxx
libmysqlclient.so.10 is needed by (installed) xxxxxxxxx
libmysqlclient.so.10 is needed by (installed) xxxxxxxxx
where xxxxxxxxx is a different program that is installed on the system. On my server I have libdbi-dbd-mysql, MySQL-python, perl-DBD-MySQL, and php-mysql. This leaves two options. The first choice is to download each of the RPM's for the programs listed, uninstall them from the system ('rpm -e xxxxxx'), install the new MySQL version, and proceed to install each of the packages again.

This is not the only way. Try downloading the MySQL Server, Client, Libraries and Headers, and Dynamic Client Libraries (including 3.23.x libraries). You will then install all four of the RPMs at the same time (MySQL-shared-compat includes libmysqlclient.so.10, therefore allowing you to upgrade, and keep libmysqlclient installed). You may be wondering what the Client package is for. The Client package isn't required, but it is highly recommended. It gives you the ability to access the MySQL server on that computer by allowing you to be able to set passwords, edit/retrieve/store data, and many more things.
To install all four RPMs at the same time just have one after another (separated by a space).
I ran the command, 'rpm -Uvh MySQL-server-4.0.20-0.i386.rpm MySQL-shared-compat-4.0.18-0.i386.rpm MySQL-client-4.0.20-0.i386.rpm MySQL-devel-4.0.20-0.i386.rpm'
It worked perfectly and updated MySQL from 3.23.x to 4.0.20. (If you didn't install the MySQL server with Red Hat, this will just install the package).

This isn't the end for MySQL. We need still have a few commands left. If you read through the output of the RPMs you just installed, you will see information about setting a root password for the MySQL database. Use the command given: 'mysqladmin -u root password XXXX' where XXXX is the new password you want to set. If you want the root password to be '12345' you would enter 'mysqladmin -u root password 12345'.

Next, it is time to check if the MySQL server works by testing if you can connect to it and store/retrieve information. In your Terminal type 'mysql mysql -p'. This will attempt to log into MySQL, the '-p' is to have it prompt for password. If you leave it off (go ahead and try) it won't let you in. Enter the password you just set for root access. You should see a new prompt that looks like 'mysql>'. You are now inside MySQL and can store/retrieve data by using MySQL commands. We won't get into the commands for MySQL right now, but just to see that it works use the command 'show databases;'. This should return that you have two databases, MySQL and test. To leave the MySQL prompt type 'exit'. MySQL will say goodbye and kick you back to the main Linux prompt.

Quote:
This screen shot shows the use of MySQL. It is a very basic command to show the databases on the server, but it demonstrates how to get into MySQL, get some data, and log out.


Congrats! MySQL is now installed on your server, and should automatically start when Linux boots (this was programmed into the RPMs you used and therefore you don't need to add it to the boot list).

Note: If your server is going to be accessed by external sources, you will need to open ports in the firewall to access the server. To open access to a certain port:
- RedHat --> System Settings -->Security Level.
- Edit the firewall to allow incoming connections either by device, or by port (service).
[page]
As with most servers, I also need a FTP server. A website with no FTP server is a very lacking website. For this aspect, I recommend ProFTPd. ProFTPd is a very powerful, very well known FTP server for Unix/Linux. You can find ProFTPd at www.proftpd.org.

Just like the other installs, grab the source .gz in the upper left corner of the page. Download it to a convenient folder and un-zip it. My version of ProFTPd is 1.2.9, so from now on, wherever you see 1.2.9, interject your version.

Just like before, navigate your Terminal to the ProFTPd folder and type, 'cd /root/proftpd-1.2.9'. This should bring you to the ProFTPd folder. Now to install it type the same commands as before, './configure', 'make', and 'make install'. If all goes well, you should have ProFTPd installed in a few minutes and be ready to configure it.

To configure ProFTPd you need to edit some configuration files. This can be very easily done and directions for doing so can be found at ProFTPd's website.

For my server’s configuration I chose a Web-Based GUI for Linux called Webmin. Webmin allows you to edit many different servers on your Linux machine. If you’re interested in Webmin, download Webmin from www.webmin.com.
Then download the noarch.rpm version of webmin-1.150-1.

Installation is very easy. The instructions found on Webmin.com say that it only requires one command, 'rpm -U webmin-1.150-1.noarch.rpm'. The admin username will be 'root' and the password is set to your current root password. To log into Webmin (to use it) go into Mozilla and type 'http://localhost:10000/'.

Sure enough, run the RPM with the command above and the package installs perfectly. I opened up Mozilla and went to the address above and everything looks good. Log in with 'root' and your root password and you can configure all of your servers from within Webmin using an easy to navigate GUI (graphical user interface).

When I first got into Webmin, I went straight to Servers --> ProFTPd to try and configure it. Then I received a message about not having ProFTPd installed on my computer. I tried rebooting the computer, but to no avail. The problem was that Webmin thought the installation was installed to a location where it really wasn't. To correct this I clicked the link for editing the module config. Under 'Path to ProFTPD config file' all it had was /etc/proftpd.conf which should have been /usr/local/etc/proftpd.conf. I found this out by going in my Terminal and typing 'find / -name proftpd.conf' which searched the hard drive and told me the path to the file. I did the same for each of the others, but didn't find any files called ftpusers or proftpd.pid. I figured I'd give it a shot with the two new values and sure enough, I was able to get into the configuration panel for ProFTPd. This panel has many options. Most of the options are very basic, but I wasn’t able to find how to allow or disallow anonymous connections. After about an hour of learning the .conf file structure and how to use it, I found editing the .conf file (through Webmin) easier than messing with the menus.

Quote:
This is the server section of Webmin. You can add support for other servers by downloading modules from Webmin's website.


Quote:
This is the ProFTPD section of Webmin. From here you can edit all of the settings for your ProFTPD server. I find that editing the configuration file is sometimes easier, but Webmin has support for almost all of the options.


To create more users and groups, you can either use the Terminal and the commands ‘useradd’ and ‘groupadd’ or you can use Webmin. Under the System tab there is a button to edit Users and Groups. Here you can make/edit/delete Users and Groups. I created a users-ftp group to use for any users I want to allow access to the FTP. You can also edit users and groups through Red Hat's Users and Groups configuration panel. To launch the panel: RedHat --> System Settings --> Users and Groups.

Quote:
The main Users and Groups Configuration Panel in Linux. From here you can configure your Users and Groups.


Quote:
From here you can add a new user, give them a nickname, set their home directory, and adjust their shell.


Quote:
If you want to change anything about a particular user, you can edit all their properties.


Quote:
From the Groups tab, you can create, modify, and delete User Groups on your Server.

You can allow/deny connections to certain FTP servers depending on group permissions by using certain .conf commands. The block below would allow access to the user 'impact' and anyone in my users-ftp group, but deny access to anyone else.
<Limit LOGIN>
AllowUser impact
AllowGroup users-ftp
DenyAll
</Limit>

Here is a copy of my .conf file. The '#' signals a comment, and anything after that (on the same line) is disregarded. I have tried to provide adequate comments to guide what is going on.
-----------------------------------------------------
#set the name of the server
ServerName "ProFTPD Default Installation"
#set the type of server, 'inetd' can also be used.
ServerType standalone
#says there is a default server for when requests dont
#meet other virtual host connections
DefaultServer on
#set the port to use for the default server
Port 21
#umask, way too much to explain right now, check proftpd.org
Umask 022
#max number of instances, use something around 30 to
#prevent DOS hack attacks
MaxInstances 30
#dont use the FtpUsers list
UseFtpUsers off

#Set the User and Group that ProFTPD will run under when started
User nobody
Group nobody

#Jail the user to their home directory (~). This moves their root ('/') to
#whatever their home is, locking them from getting around to system
#files that they shouldn't get into.
DefaultRoot ~

#generally want to allow overwriting
<Directory />
AllowOverwrite on
</Directory>

#I made a dummy account called 'dummy', this account's root
#directory is /ftproot/anon (my anonymous folder)
#I want my anonymous block to use the default root of dummy
# you could change ~dummy to /ftproot/anon/ and get the
#same results
<Anonymous ~dummy>
#dont require a password for anonymous accounts
AnonRequirePassword off
#once connected as an anonymous user, take on the name/properties
#of dummy before cdroot()ing.
User dummy
Group dummy
#we want to be able to use anonymous and dummy to log in
UserAlias anonymous dummy

#only allow 25 people to use the anon account at the same time.
MaxClients 25

# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message

#deny all write priviledges to anon users.
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>
<Global>
</Global>
---------------------------------------------------------------
Note: It took me forever to figure out what was going wrong with my anonymous script. ALL anonymous scripts are voided (completely ignored) if the 'root' account is currently logged in. If you are in the computer as 'root' and are trying to connect anonymously from another computer, it won't work.

Security Note: Never log in as 'root' over FTP. FTP passwords are unencoded plain text passwords. Logging in as root over FTP is like giving away your root password to anyone that wants it.

Note: If your server is going to be accessed by external sources, you will need to open a hole in the firewall to access the server. To open access to a certain port:
- RedHat --> System Settings -->Security Level.
- Edit the firewall to allow incomming connections either by device, or by port (service).
[page]
Well, I personally would like to be able to manipulate files on my server without having to log in via FTP every time. This involves setting up a File Server. In Linux we have a file server named 'Samba', lets take a look.

First off, I grabbed the newest distribution source codes from the samba website (www.samba.org). You have two options you can go with, 2.x or 3.0.x... I decided to go with the newer 3.0.4 Samba Server Source code (on the main page). After downloading and unzipping, navigate to your source folder (for me, /root/samba-3.0.4/source/), then run the commands to build and install the source code: './configure', 'make' and 'make install'. In a few minutes you should have the most up-to-date Samba server installed in /usr/local/samba/.

If you go to the Samba Server Config Panel (RedHat --> System Settings --> Server Settings --> Samba Server) you will notice the ability to manage everything regarding your file server. Let's get started.

Quote:
The Samba Server Config Panel allows access to all the basic functions of Samba.


First things first, I'm going to want my main user 'impact' to be able to get any files from his home directory '/home/impact/' through Samba. Well, this is actually much easier than you would think. If you fire up Webmin, there is an option for having all Linux Users to access their own Home directory with their Username and Password.

Quote:
You can also edit all of your Samba Server's options through Webmin!


Well, I couldn't see my Samba server right away, but after a few minutes it popped up where it should be. I could see it, log in, and edit files from my Windows computer.

Quote:
When I logged in on my Windows computer, I was able to see my LinuxBox's Samba Share.


Quote:
Once I logged in using my Samba Username and Password, I was able to easily copy files from my home directory. In this case, all the screen shots I had been piling up on my Server.


If you want, you can configure the Samba Server through Webmin. I prefer the Red Hat installed config program because it is an easier interface and does everything I need it to do. Webmin does offer some more in-depth options and a cool function to synchronize Unix and Windows accounts for Samba. I have yet to test it, but if you were to have a large scale network and wanted to save time, I assume you could use this function to save you from setting a directory, password, and windows account for each user.

Time to get Samba to start with Linux. Just as you did with Apache, open up /etc/rc.local in an editor. Add two more lines to the bottom:
/usr/sbin/smbd -D
/usr/sbin/nmbd -D
These are the two commands to start Samba, and now will be executed whenever the system starts.

Quote:
My rc.local file after adding both Apachectl (Apache), Samba to my list of things to start at boot.

[page]
This concludes our Basic Red Hat Linux Server Guide. At this point you should have a complete, working server. The server should be running Apache, PHP, MySQL, Samba, and ProFTPD.

Almost everything on your Linux Server can be edited through Webmin. I suggest not leaving the Webmin port open to the public though because it allows anyone to come in and edit settings on your Linux Server (huge security problem). Only use it for on your home network and disable Webmin when you aren't going to be needing it.

Quote:
The System panel in Webmin. Edit users, restart the computer, manage processes and much more!


Quote:
Log into Webmin's MySQL interface and edit all of your MySQL Server's properties.


I cannot stress enough how powerful each of the components we installed are. With them you can create some of the most powerful websites in the world. All you need are the more advanced configurations. Alas, these configurations were outside the scope of our 'Basic' tutorial, but keep checking back and we may have some more advanced looks into some of these programs.

Some other functions I found helpful in Linux were things like TraceRoute, System Monitor, and the Login Config Panel.

TraceRoute lets you trace the route, or hops, to any server on the internet. Just type in the address and watch it trace. In my example I just traced the route from my house to the AbsoluteInsight.net server.

Quote:
Trace the hops from your computer to any address in the world.


The System Monitor Panel allows you to monitor disk usage, CPU usage, and all the running processes (and kill them).

Quote:
System Monitor allows you to view and manage the processes running on the computer.


Quote:
System Monitor also allows you to watch the CPU, Hard Drive, and Memory usage of your server.


The Login Config Panel allows you to set up things like auto-logins and the login screen.

Quote:
The Login Panel lets you edit things like auto-login, timeouts, and greeters.


Quote:
The Login Panel also allows you to edit schemes and login messages.


Quote:
You can also change the look of the login page to whatever suits you.


If you have any questions about anything in this tutorial please feel free to ask them in the comments section. Expect to see more in depth Linux tutorials here in the future.


Last edited by Impact on Mon Aug 23, 2004 2:06 am; edited 1 time in total
Back to top
kompakt Reply with quote
Innovator


Joined: 17 Jun 2004
Posts: 1475
Location: Eden Prairie, MN

PostPosted: Thu Jun 17, 2004 12:54 pm    Post subject:
 
hmm......interesting. i think weve got a downloaded version of redhat linux 7.0 somewhere, but what im interested in is some in depth info on SUSE linux 9.1(we just downloaded it to try it). if anyone has some links to info, please reply!
Back to top

Impact Reply with quote
Site Admin


Joined: 01 May 2004
Posts: 3257
Location: Pinecrest, FL

PostPosted: Thu Jun 17, 2004 1:00 pm    Post subject:
 
the SuSE install was difficult due to being a completely FTP install. Once running I couldn't notice much of a difference between Red Hat and SuSE... Didn't delve into it that much...
Back to top

kompakt Reply with quote
Innovator


Joined: 17 Jun 2004
Posts: 1475
Location: Eden Prairie, MN

PostPosted: Thu Jun 17, 2004 5:57 pm    Post subject:
 
well i found a site that happens to be SUSE's site and its got all the info on SUSE linux 9.1 and other products. looks like quite a package! its got proffesional 3D software, universal messenger, etc. heres the URL : http://www.suse.com/us/private/products/suse_linux/index.html
Back to top

Impact Reply with quote
Site Admin


Joined: 01 May 2004
Posts: 3257
Location: Pinecrest, FL

PostPosted: Thu Jun 17, 2004 6:09 pm    Post subject:
 
check out linuxiso.com for ISO's for most of the distros =P
Back to top
Post new topic   Reply to topic    Absolute Insight Forum Index -> Articles
Page 1 of 1

Choose Display Order
Display posts from previous:   
User Permissions

 
Jump to:  


Skin Created by: Sigma12
Powered by phpBB © 2001, 2002 phpBB Group