Hello, please sign in or register
You are here: Home

Installing Fedora Core 4 Server

Preface

Controversially, i am taking on my window cleaning colleagues with some *n*x operating software. Amongst the barrage of recommendations for Linux distributions, i concluded Fedora Core 4 had the right attributes.
The attributes included: established, up-to-date, documented, patronage and endorsed by reputable web hosts

Download

fedora.redhat.com is a pretty good place to start. Download the following files, and open them up with a CD writter.If you get bored

Burn the disks and walla!, you now have your operating system!.... or be it, ready to install

Whilst Downloading...

Read this article it'll, tell you the rest. lol, http://stanton-finley.net/fedora_core_4_installation_notes.html#PHP

Its recommended that you read the release notes http://fedora.redhat.com/docs/release-notes/fc4/errata/ and is a great way to occupy yourself whist waiting for server files to download.

Another guide http://www.mjmwired.net/resources/mjm-fedora-fc4.shtml

Without a GUI

I want to be able to edit file remotely, so unlike in stanton-finley's setup i am going raw and installing without a GUI. I will be abe to configure the machine locally through a shell and may also access remotely through SSH client, such as putty.

Install the software!, There are various options, I disabled SELinux (Red Hats extra Security, this can be enabled/disabled later)

First setup Locate

The locate command is a database table of the filesystem (i.e. like an index at the start of a book). It allows quick searches and facilitates pattern matching. You will need to create this database, and update it periodically... as your filesystem changes.

type locate -u to update the database.

Automate this with a daily cron job. Type vi /etc/updatedb.conf and edit using vi, and change the value of daily update from no, to yes. E.g DAILY_UPDATE=yes

Starting Webservice and Mysql at Boot

shell> httpd. This command will start your webserver. You should already be able to ping the server, but now you will see a fedora core splash screen in your browser

To start yor mysql deamon aka mysqld type shell> service mysqld start

To start on boot the 'subsystem process' (e.g. webservers, database server, network stuff... i.e. programs).


// go to directory...  

shell \>  cd /etc/rc.d/rc4.d/

// httpd (webservice)

shell \> mv K15httpd S15httpd

// mysql

shell \> mv K36mysqld S36mysqld

//smb (filesharing client)

shell \> mv K35smb S35smb



// Because i edited directoy /etc/rc.d/rc4.d/  ( aka runlevel 4 boot subsystem processes )

// we now change the boot inittab to boot to this runlevel.

// Previously runlevel was 3, or if you installed a GUI it will be 5.

// if you still want to boot with GUI repeat the renaming of files but within /etc/rc.d/rc5.d/ and dont follow the next step

shell \> vi /etc/inittab

// in vi mode

// Change  the line "id:3:initdefault:" to read...

id:4:initdefault:

The logic behind the boot order process.

Open up and have a look at the files in

/usr/rc0.d

,

/usr/rc2.d

...

rc6.d

. The content of these directories is very similar and contains files with run commands which start and stop their associate programs. The filenames themselves are prefixed with either a K or an S. This denotes whether the process is to be stopped(Killed) or Started. The directories themselves are numberered according to the boot process. When your machine is switched on it will be at boot process 1 then it will progress to boot levels 2 and then 3. Run level 3 is a shell level aka the shell command is set. Runlevel 4 is by default set to the same as level 3, runlevel 5 is reserved for starting GUI's

/usr/rc4.d

 

Create User and Group accounts

groupadd users

useradd drew -p mypassword

Setting Up Samba (Share filesystem accross multi platform OS)

After reading (too much) on this topic, my procedure was...

Accees windows from linux

The steps....

Unblock ports 139 and 445.

Either disable the firewall totally: Type shell> SERVICE iptables STOP or shell> /sbin/service iptables STOP, or permintantly by editing iptables in the boot processes as above

Or To alter the iptables config to open the default Samba ports 139. 445.


shell \> vi /etc/sysconfig/iptables

// Within vi add the two lines...

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT

// save and close



shell \> service iptables restart

Edit
smb.conf

Replace the

smb.conf

Samba configuration file.

 

shell># mv /etc/samba/smb.conf /etc/samba/smb.conf.swap

shell># vi /etc/samba/smb.conf

You are now in a blank vi editor. Write the following configuration into the document vi help.

/etc/samba/smb.conf

[global]

        workgroup = insureandgo
        netbios name = linux
        server string = Samba
        os level = 65
        security = user
        encrypt passwords = yes
        preferred master = yes
        localmaster = yes
        use sendfile = no
        log file = /var/log/samba-log
;.%m
        log level = 3
        lock directory = /var/lock/samba
        username map = /etc/samba/smbusers
;       share mode = yes

        hosts allow = 192.168.2. 192.168.1. 127.0.0.1
        interfaces = 127.0.0.1/255.0.0.0 127.0.0.1
        wins support = yes
        browseable = yes
        smb ports = 139 445
        smb passwd file = /etc/samba/smbpasswd
        max log size = 50

[homes]

        comment = Home Directories
        read only = No
        create mask = 0644
        directory mask = 0755
        browseable = No

# The following shares give access to web directories


[web]
        comment = Web Directories
        path = /var/www/
        read only = No
        Guest ok = No
        Create Mode = 0755
        public = No

Additionally add users to smbpasswd file alike

# smbpasswd [-a] [-x] [-d] [-e] [-D debuglevel] [-n] [-r remote machine] [-R ] [-m] [-U username[%password]] [-h] [-s] [-w pass] [-i] [-L] [username]  smbpasswd -a myuser  

// prompts will let you add a password for this user.

You can test your file with

shell \> testparm /etc/samba/smb.conf

Connect to a windows share.


Type smbclient -U 'Administrator' -L \\192.168.1.14. Type your windows password when prompted.
You should now see a list of shared directories e.g.

        Sharename       Type      Comment
        ---------       ----      -------
        cheap           Disk
        E$              Disk      Default share
        IPC$            IPC       Remote IPC
        D$              Disk      Default share
        books           Disk

Browse a shared folder.

shell: \> smbclient -U 'Administrator' \\\\192.168.1.14\\books

// a password prompt will appear type the Remote Computers password for administrator

// your prompt will change to

smb: \> 

// view files and subfolders in share file books

smb: \> ls

To access a folder like it was part of the linux filesystem. i.e. without having to use smbclient to view and edit these files. Alike "Map network Drive" in windows


// create a symbolic file

shell \> ln -s ./dev/books/

// samba mount to this symbolic link

shell \> smbmount //192.168.1.14/books /dev/books -o username=Administrator, password=mypassword

// make this mount on boot edti the file etc/fstab

shell />vi /etc/fstab

// insert the line into the file

//  "smbmount //192.168.1.14/books /dev/books -o username=Administrator, password=mypassword"

Accessing Linux from windows

This took me days to figure out

1. From linux command. Check the access to localhost via the smbclient. This will show whether the ports are open

smbclient -L \\localhost

// you dont need to change or alter the firewall for this because it should allow all requests from   127.0.0.1

If you see something alike

...

Connecting to 127.0.0.1 at port 445

error connecting to 127.0.0.1:445 (Connection refused)

Connecting to 127.0.0.1 at port 139

error connecting to 127.0.0.1:139 (Connection refused)

Error connecting to 127.0.0.1 (Connection refused)

Connection to localhost failed

Try restarting samba using


root@linux etc]# /usr/sbin/smbd -D

[root@linux etc]# /usr/sbin/nmbd -D

If this all works you shall see your shared folders as well as network servers

Mapping from Windows

In windows client go. windows > explorer > tools > map network drive.
Type in the folder: \\linux\web
You should now see the files in this directory

To create a folder/file within this mapped drive. Access permissions need to be set.

#find the current permissions 

shell \> cd /var/www/

// View a verbose list of the files and folders their, owner, usergroup  and access rights 



// e.g. root root drwxr_xr_x cgi_bin

shell \> ls -l

// Make a new directory

shell \> mkdir books

// edit its owner:group

shell \> chown drew:user books

// Set access to all 777, user 775 for all edit but non-user cant write 

shell \> chmod 777 books

// i'll change this latter

 

Webserver
Httpd.conf

Setting up VirtualHost for my doamins and their subdomains. i folowed these steps

1. Copy the VirtualHosting section from my previous server.

2. Find and revalue the parameters of

/etc/httpd/conf/httpd.conf

 


UseCanonicalName off
NameVirtualHost *
# Virtual host Default Virtual Host

3. I got an error ...

[error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results

... which i solved my renaming ssl.conf

 


rn /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak

Now to ensure that the website permissions and user are set so we can login and edit the files using Dreamweaver write the username e.g. 'drew' and group e.g. 'user'


chown -R drew:user /var/www/

Install additional PHP Libaries

Yum allows you to download new programs/ modules and updates for your system files. alike redHats RPM. I like this alot. My PHP program didn't come with mysql module or the graphics module `gd`. The below is the command to download these modules. [CODE=shell]# Installs mysql.so the php-mysql connection functions yum install php-mysql.i386 # Installs gd2.so the php-gd image creation functions. yum install php-gd.i386

Creating a remote MySQL user




shell \> /usr/bin/mysql

# in mysql 

mysql > GRANT ALL ON * TO 'drew'@'%' INDENTIFIED BY 'word'

# note the PASSWORD() function does not need to be used 

I downloaded the MySQL Query Browser and MySQL Administrator from www.mysql.com on to my client machine Opening the MySQL Administrator, i can Connect using the IP address of the new server, the user name 'drew' and password 'word' on default port 3306 Select: 'Health' > 'System Variables' > 'General' > 'Directories and Files' Theres a list which displays the location of mysql files and directories on your linux box. The variable name 'datadir' is the address given to the location of the database directories and files stored on your machine. e.g.

/var/lib/mysql

Sharing the Linux datadir

Edit the file

smb.conf

as mentioned above to share the datadir on your network




shell \> vi /etc/samba/smb.conf



# now in vi editor append the lines...



[datadir]

comment = MySQL Datafiles

path = /var/lib/mysql

read only = No

Guest ok = No

Create Mode =0755

public = No



# wrie and save 



Now map this from your client machine. Edit the sharing of this file so you can change and edit files.




shell \> chmod 777 /var/lib/mysql/ -R



Migrating / Copy contents from Windows to Linux




shell> mount -t smbfs -o username=Administrator,password=youllneverguessit //192.168.1.14/books /mnt/books

shell> mount -t smbfs -o username=Administrator,password=youllnevergetit //192.168.1.14/booksharp /mnt/booksharp



# copy these files to the respective new location on the server



shell \>cp -r /mnt/booksharp/ /var/lib/mysql/



shell \>cp -r /mnt/books/ /var/www/books/

To enforce a mount on boot [CODE=/etc/fstab] //192.168.1.14/igweb04data /mnt/igweb04data smbfs noauto,user,username=un,password=pw 0 0

My.cnf
tweaking

The

my.cnf

file is located at

/etc/my.cnf

on this distribution

 


# Change the fulltext to index all words except those in stopfile

ft_stopword_file='/etc/mysql/ft_stop_word.txt'

ft_min_word_len = 1

 

Create the fulltext-stop-word-list. Open up vi with vi

/var/lib/mysql/ft_stopword.txt

. Write and save the following line into the file (or choose your own words)

 


the, a, and, if, to, in, or, on, by

Repair Database (recommended)

I repaired my main search table. To be sure that the effects had taken, and their wasn't going to be any conflicts between the two configurations.

External Referene

http://www.falkotimme.com/howtos/perfect_setup_fedora_core_4/index.php http://www.howtoforge.com/perfect_setup_fedora_core_4

 

 

Comments

Title*
Comment

Prove you are not a robot

To prove you are not a robot, please type in the six character code you see in the picture below
Security confirmation codeI can't see this!
Contact
Name*
Email never shown*
Home Page

Author

Andrew Dodson
Since:Feb 2007

Comment | flag

Categories

Bookmark and Share