Você está na página 1de 5

One thing you have to do before you can begin following this tutorial is to turn

on your computer :-). Check your BIOS settings to see if the CD-Drive is the pr
imary boot device. If not, change it or else you won't be able to install linux.
So, turn on your computer and insert the Mandrake 10.1 CD1 into your CD-drive.
Choose English(American) as the language, and then click Next.
Choose Accept if you agree (which you should) and click Next.
Choose Next, without changing any settings.
Partition the disk the way you want it.
Format the partitions.
You should now see 4 checkboxes. Deselect Installation CD3 and 4.
When you get to Package Selection, deselect everything except KDE workstation, C
onfiguration, Console Tools, Development and Documentation.
Wait while Mandrake is being installed, this can take over 30 minutes and you wi
ll have to insert CD2 somewhere in the installation process.
When done, enter your root password twice. This password is very important and w
henever I say root password in this guide, I am talking about this password. Don
't forget it! Click Next.
Create a user, I created a user sebsz with a password :-). You can choose an ico
n if you like, but you don't have to.
When it says "I can set up your computer to automatically log on one user", clic
k Next.
You might be asked where you want to install the bootloader, choose the MBR.
You are now at the Summary page. You can configure many things here. I always fi
rst change my Country/Region to my own country (Malta). If you don't live in the
United States, then change this. If you don't see your country, click "More Cou
ntries". You might have to insert CD1 again to install the appropriate packages.
I have decided not to configure my Network connection yet, we will that later on
in KDE. You will find out later what KDE is.
Click Next when you are done configuring. Now you can select if you want to inst
all and download updated packages. I chose NO because my network isn't configure
d yet. I recommended you follow what I do to avoid problems later on.
Now the installation is complete, take out your CD and click Reboot.
Mandrake Configuration

When Mandrake finishes booting, you should get a screen "Welcome to Firstboot".
Choose "Do not answer survey" and click Next. Click Next again. And click Next a
gain.
Now KDE 3.2 loads. KDE is your graphical interface which you will use to configu
re some settings in Mandrake. When you get "Welcome to Mandrakelinux!", at the b
ottom deselect "Open this window on startup" and click close.
Click the Star in the bottom left corner, go to System | Configuration | Configu
re Your Computer. Enter your root password and click OK. The Mandrakelinux Contr
ol Center will now load.
Click Network and Internet and then Internet access. Enter your Host Name. Your
Host Name is your FQDN (Fully Qualified Domain Name). Most probably you are foll
owing this guide because you want to host multiple domains on the same server. J
ust enter your main domain name here. I am entering maltastart.com, even though
I will also be hosting sebsz.com, da40.info, flyingsociety.info and sebszhost.co
m. Don't worry about it, just enter your main domain name. :-S
Now enter your First and Second DNS Servers. These are used so your server can c
onnect to the Internet. Later on you can configure Mandrake to be a DNS server i
tself, but for now enter your ISP's DNS servers. Click OK to apply the settings.
Now click Manage Connections. You should have 2 ethernet cards in your computer.
One will be used to connect to the Internet (eth0) and the other one will be us
ed to connect to your LAN (eth1). At the top "Device selected" choose eth0 and t
hen configure it for Internet access. This differs for every ISP. I have a cable
Internet connection and a static IP address, so for Protocol I am choosing 'sta
tic'. Then I enter my IP address, Netmask and Gateway. Now choose eth1 from the
"Device Selected" list and configure this one for internal LAN access. My networ
k uses 192.168.0.x. Your network might be different. Enter a subnet mask that is
the same as all other computers in your network. We will soon configure our ser
ver to share the Internet connection with the LAN. This way your entire LAN is '
behind' the Mandrake server and all Internet traffic will go through the Mandrak
e. This is good because you can then install a firewall.
If everything went well, you should now have Internet access. We will now switch
to command-line mode. Press CONTROL+ALT+1. Your screen should now show "Login:"
. Enter 'root' and press enter. Then enter your root password. You should be log
ged in now and see something like "[root@yourhostname root]#"
Before we continue, go to another computer in your network and try pinging the s
erver's internal IP. I gave my server an IP of 192.168.0.1. If you are getting r
eplies, then that is great :-).
Every time you need to install a package, it is easiest to use 'urpmi'. 'urpmi'
is a tool that allows you to install packages easily and it also takes care of d
ependencies. By default, urpmi uses files that are on your Installation CDs. How
ever, we want the newest versions, so we are going to configure urpmi to automat
ically download files from the Internet. Go to http://easyurpmi.zarb.org and che
ck the 3 boxes under "1)Core distribution". In each of the drop down lists, choo
se a mirror that is closest to your physical location. For example, if you live
in Europe, don't choose an Australian mirror. Scroll down when you've done that
and click 'Proceed to step 3'. Now 3 commands should show up, each of them start
ing with urpmi.addmedia. On the server, first run the command 'urpmi.removemedia
-a'. This removes all urpmi media, which currently are your CDs. When you do th
is you won't have to insert any CD into your system anymore. Now enter the 3 com
mands and press enter. Each command might take a while to run because it will do
wnload package lists from the net, these can be up to 30MB. When you are done, b
e happy. :->
Now we are going to install SSHd. This allows us to connect to our server from a
nywhere in the world with an ssh client and run commands just as if we had physi
cal access. Type 'urpmi openssh-server' and press enter. Wait for the packages t
o be downloaded and installed. After that run 'service sshd start' to start it u
p. That's all there is to it ;-). Note: if you want to enable user 'root' to be
able to log in through ssh, type 'vim /etc/ssh/sshd_config' and find "PermitRoot
Login no". Change the no to yes by pressing 'i' to enable insert mode, and then
remove no and write yes. Save by pressing Escape (to exit insert mode) then type
':wq' and press enter. This saves and quits the editor. To enable the changes y
ou just made to sshd, type 'service sshd restart'. This restarts sshd and applie
s the new configuration.
Now we will install iptables to enable Internet sharing. Just type 'urpmi iptabl
es', press enter and wait.
Now type "vim /etc/rc.d/rc.firewall-2.4". To start adding data, press 'i' . This
enables 'insert mode' so you can type text. Now put all the data from (http://w
ww.sebszhost.com/rc.firewall-2.4) file in there. Then press ':wq' and press ente
r. This saves the file and quits. Now type "chmod +x /etc/rc.d/rc.firewall-2.4"
that makes the file executable. Now write "vim /etc/rc.d/init.d/firewall-2.4" an
d put the data from this file (http://www.sebszhost.com/firewall-2.4) in there.
Save the file (:wq) and make it executable (chmod +x /etc/rc.d/init.d/firewall-2
.4). This file will enable Internet sharing! Type /etc/rc.d/rc.firewall-2.4 and
press enter. You should get a couple of messages, and when it is done you should
be able to access the Internet on PCs in your LAN. Make sure you configure the
LAN PCs to have the same subnet mask as the server, an IP in the same range (if
server is 192.168.0.1, make the clients 192.168.0.2, 192.168.0.3, etc.), and the
ir gateway should be set to the server's IP (for me, 192.168.0.1). If that works
, well done!
Install FTP Server: "urpmi proftpd", "vim /etc/proftpd.conf", change servername,
uncomment "#DefaultRoot ~" by removing the #. Save, and run "service proftpd st
art"/
Install Apache Server: "urpmi apache2", choose "Y" when it asks "Is this OK?"
1. "vim /etc/httpd/conf/httpd2.conf" and add this at the bottom for every virtua
l host you want:
NameVirtualHost yourip
<VirtualHost yourip >
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ServerPath /home/
DocumentRoot /home/user/public_html
</VirtualHost>
Substitute yourip with your external ip address, such as 213.165.180.111. Substi
tute yourdomain.com with the domain you want to host on the server. Let's say yo
ur domain is called freefood.com. Then there would be a user called freefood on
your system in /home/freefood/. In there is a directory called public_html, all
Internet files go in that directory. The world can then access the files by goin
g to www.freefood.com. Make sure you have configured your domain name to point a
t your IP address. If you have questions, email me.
To create a user, we run "adduser username". Then you type "passwd username" and
you will then have to enter his password twice. Now a directory has been create
d, /home/username. I am sure you have some questions, just email me.
Install MySQL: "urpmi mysql", then choose "1", then choose "1", and then choose
"y". This will install a lot of things, be patient.
Install PHP: "urpmi apache2-mod_php", then choose "Y" when it asks "Is this OK?"
1. "urpmi php-cli" for command line php
2. "urpmi php-mysql" to use mysql in php
Install Perl: "urpmi perl", then choose "Y" when it asks "Is this OK?"
Now run "service httpd start" to start apache. You can now test your websites. I
f you haven't uploaded any data yet, connect with an ftp client to your server o
n port 21. Enter a username and password (make sure to create the user with addu
ser username, like I described above). When you are logged in, create a folder c
alled 'public_html' and upload your files in there. Your website should now work
. You can also test websites using http://yourip/~username/.
Install Webmin:
Webmin allows you to configure your server through web-based configuration websi
te. Run "urpmi webmin" and choose "Y". Then run "service webmin start" to start
webmin. You can now go to "https://www.hostnameorip.com:10000". Log in with root
and your root password, and you can configure things and add users, etc.
If you want to be able to download files at command line, "urpmi wget" ;-)
Configure some MySQL:
first start the mysql server, "service mysql start"
then connect to the mysql server, "mysql -u root mysql"
type: SET PASSWORD FOR root@localhost=PASSWORD('yourrootpass'); and press enter.
Then type quit and press enter.
Install PhpMyAdmin:
PhpMyAdmin is used to configure and maintain mysql databases and tables. Downloa
d the source from phpMyAdmin choose the one that is .tar.gz, and put it in a dir
ectory on your server, such as /downloads. Now run "tar -zxvf phpMyAdmin-2.x.x.t
ar.gz". Now create a directory where you want phpMyAdmin to go, such as "mkdir /
home/user/public_html/phpmyadmin/" then run "mv phpMyAdmin-2.x.x/* /home/user/pu
blic_html/phpmyadmin/ -f". Now we will edit the configuration file. Go into the
directory where phpmyadmin is now, and write "vim config.inc.php". In the file w
here it says "$cfg['PmaAbsoluteUri'] = '';", between the ' ' write the path to t
he directory where you can access phpMyAdmin, for example http://www.yourdomain.
com/phpMyAdmin/. Now find "auth_type" and change it from 'config' to 'http'. A b
it lower, where it says 'controluser' and 'controlpass' and enter here for user,
root and for password the one you specified above (mysqlrootpass).
Now you can access phpmyadmin by going to http://www.yourdomain.com/phpmyadmin/.
You will be asked for a username and password, enter the ones you entered above
and you can create a new user. Don't log in with root, it is better if you log
in with a new user and giving that user administrator permissions.
Install AwStats:
AwStats provides a lot of statistics about your http server, but can also be use
d to analyze ftp and mail logs. AwStats will show you bandwidth usage, what webp
ages are accessed most often and much more. Type "urpmi awstats". Now enter "vim
/etc/awstats/awstats.conf". Scroll down checking if everything looks alright. W
hen you find DNSLookup=2, change it to DNSLookup=1. Now near the bottom in the P
lugins section, you should find "#LoadPlugin="geoipfree"". Uncomment this to use
the GeoIPFree plugin. This plugin will show you what country the user is coming
from. Now we need to install the plugin. Run "perl -eshell -MCPAN" . Because it
is the first time we are running CPAN, it will ask us a load of questions. Pres
s enter for all of them, until you see a list of Continents. You need to choose
the continent you are in by typing the number in front of it, then choose a near
by country. Then you get a list of mirrors, just choose one by typing its number
and pressing enter. Then type ENTER again. Now you should see "cpan>" type "ins
tall Geo::IPfree" and press enter. This will install the plugin. Type quit to ex
it CPAN. Now we need to update our awstats database, because it needs to analyze
the apache log file. This is done once a day automatically, but we want to do i
t manually now. Go to /var/www/cgi-bin. Then type "perl awstats.pl -config=hostn
ame -update". This will generate the database. If you now go to your main hostna
me like this: http://www.hostname.com/cgi-bin/awstats.pl , you will see your sta
ts. ;-)
Install PhpSysInfo:
PhpSysInfo can list a lot of information about your system, from things like you
r processor to memory usage and disk usage. It is also possible to show your har
dware's temperature and it also shows the operating system. Download it from her
e and get the .tar.gz file. Put it on your server in the /downloads folder. Now
run "tar zxvf phpsysinfo-2.x.x.tar.gz" and then create a directory somewhere tha
t is accessible from the Internet where you want the information to be accessibl
e. Then move all data inside the phpsysinfo-dev/ folder to that folder: "mv phps
ysinfo-dev/* /home/user/public_html/phpsysinfo/ -f". Now go to that directory an
d run "mv config.php.new config.php" to rename the config file. Now run vim conf
ig.php and change any settings you would like to change. The default settings wi
ll also work. Before phpsysinfo works, you need to restart apache. Go ahead, "se
rvice httpd restart". Now you can go to http://www.yourhost.com/phpsysinfo/. Mos
t likely you will get an error saying phpsysinfo needs an xml module. Run "urpmi
php-xml" and it will be installed. Restart apache again and phpsysinfo will wor
k.
Installing qmail with secure SMTP and multiple domains and users
qmail is a good mail server that you can use on your mandrake server. Follow eve
ry step and it should work:
There is no point in me repeating what someone else has done very well. Please a
ll visit Bill's Linux qmail Toaster (http://www.shupp.org/toaster/) and follow h
is instructions. I will do the same right now, and any problems I encounter I wi
ll list right here:
Problem #1: Make sure you run these commands before starting the tutorial:
1. urpmi gdbm
2. urpmi gdbm-devel
3. urpmi openssl-0.9
4. urpmi openssl-devel
5. urpmi stunnel
6. urpmi krb5-devel
If you get a message saying it is already installed, that is alright. Just make
sure you install the rest.
That concludes this how-to. I just followed the entire tutorial on my test serve
r, and everything worked fine and it took me exactly 2 hours, 4 minutes and 43 s
econds! To give you an idea, the Mandrake 10.1 installation, formatting harddisk
s, etc. took only a total of 11 minutes! Configuring linux is a lengthy process,
and you probably did not finish it in 2 hours. Hopefully you managed to get it
to work, if not, please email me@sebsz.com and I will answer every question you
have. Enjoy!

Você também pode gostar