Welcome on the complete tutoriel to install on an environment FreeBSD a Web server + server Metin2.
~~~~~
~~~~~
* Check of the KNOWN Mode
* Permission of an access root remote and change of the port(bearing) ssh
* Modification of the password root
* Execute portsnap for the first time
* Installation of Mysql server version 5.1
* Apache installation and PHP
* Apache configuration
* Test Web server
Throughout this tutoriel we have a machine FreeBSD 7.2 in version 32 bits with 4 Go of RAM, and 160 Go of disk space.
Begin by you live with an access ssh supplied by your host.
* Check of the KNOWN Mode
For the first access verify that you are ' great User ' thanks to the prefix ssh there if it is one
*
You are 'su' if it is one
$
It is necessary to use the command
$ SU
Then enter the root password of your dedicated server supplied in the e-mail of your host concerning the accesses.
* Permission of an access root remote and change of the port ssh
It is necessary to edit the configuration file of ssh by using the utility ' ee '
Code:
# ee /etc/ssh/sshd_config
Code:
#PermitRootLogin no.
Code:
PermitRootLogin yes
Look and of comment on the line
Code:
#Port 22
Code:
Port XX
Use the key [Esp] of your keyboard then Leave editor then Save Changes
It is necessary to make a reboot to take into account the changes. In the reboot, once the service ssh restarted you can directly connect there root on your ssh via puTTY. (Attention to change well in puTTY the informed port 22 leaves the one that you have chooses above.)
After the reboot, you thus find accommodation there root with the password which supplied you your host.
* Modification of the password root.
Under ssh use this command to change the password:
Code:
# passwd
Code:
Enterpassword:( Shall type you here your password (nothing appears it is normal, on principle of security.)
Code:
Repeat password: ( Repetition of the password (nothing appears it is normal, on principle of security.)
* Execute portsnap for the first time
If in the installation of your dedicated server you do not have or your host did not install the portsnap collection you have to make him.
( Portsnap is a software library, thanks to him you can of a simple command configure them and install them.)
Use this command to get back sources and extraires.
Code:
portsnap fetch extract
Code:
# portsnap fetch update
* Installation of Mysql server version 5.1
We open the file containing the packet mysql 5.1 in portsnap:
Code:
cd /usr/ports/databases/mysql51-server/
Code:
make WITH_XCHARSET=all install clean
Code:
ee /etc/rc.conf
Code:
mysql_enable= "YES"
Now in your next restart Mysql will run automatically.
Now restart Mysql so that the changes operate by using:
Code:
/usr/local/etc/rc.d/mysql-server restart
Code:
mysql -u root -p
Type [Enter]
You reach the console Mysql.
The first one of things to be made is to create a user with total access. We are thus going to use this request SQL
Code:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'enter password' WITH GRANT OPTION;
Code:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'mt2'@'localhost' IDENTIFIED BY 'mt2!@#' WITH GRANT OPTION; mysql> Flush privileges; mysql> quit
* Apache installation and PHP
Apache 2.2:
We are going to open the file Apache in portsnap
Code:
cd /usr/ports/www/apache22
Code:
make install clean
We are thus going to modify the rc.conf file
And add lastly the line to activate Apache 2.2.Quote:
ee /etc/rc.conf
Henceforth Apache will start in every reboot automatically.Quote:
apache22_enable= "YES"
We are going to configure Apache after the installation of php!
Php 5 :
We are going to open the file of the packet php version 5 in portsnap
Code:
cd /usr/ports/lang/php5
We have to choose Apache in the page of configuration then OK to create its module.Quote:
make config
Finish by the installation
hen we are going to install the extensionsQuote:
make install clean
Code:
cd /usr/ports/lang/php5-extensions
Code:
make config
Finish installation
Here is we have Apache and php of installed onQuote:
make install clean
* Apache configuration
It is necessary to create the module for php5, we are thus going to create a configuration file for php:
Then we are going to stick this:Quote:
ee /usr/local/etc/apache22/Includes/php.conf
Use the key [Esp] of your keyboard then Leave editor then Save ChangesQuote:
<IfModule mime_module>
<IfModule php4_module>
AddType application/x-httpd-php .php
</IfModule>
<IfModule php5_module>
AddType application/x-httpd-php .php
</IfModule>
</IfModule>
Now we are going to configure the index by default so that he adds index.php:
So in the httpd.conf file we are going to edit:
Then we fetch this part:Quote:
ee /usr/local/etc/apache22/httpd.conf
DirectoryIndex index.htmlQuote:
<IfModule dir_module>
And replace her by:Quote:
</IfModule>
Use the key [Esp] of your keyboard then Leave editor then Save ChangesQuote:
<IfModule dir_module>
<IfModule php5_module>
DirectoryIndex index.php index.html
</IfModule>
<IfModule !php5_module>
<IfModule php4_module>
DirectoryIndex index.php index.html
</IfModule>
<IfModule !php4_module>
DirectoryIndex index.html
</IfModule>
</IfModule>
</IfModule>
* Test Serveur Web
Starting up of apache2.2:
Now we can go to make out a will if Apache is functional by going to the address of our waiter in an Internet browser.Quote:
/usr/local/etc/rc.d/apache22 start
Exemple:
My dedicated serveur has for ip 123.456.78.901
I go on internet and type: http: // 123.456.78.901/
If you see the sentence It Works!
And indeed congratulation you installed Apache successfully.
Now we are going to verify the interpretation php.
Produce you on your sFTP by WinSCP for example.
You live and go in / usr / premises / www / apache22 / dated/
You go to delete index.html and to create a new file php named: index.php
Register and return you on the page of your dedicated http: // 123.456.78.901/for my example.Quote:
<?php
phpinfo();
?>
If you see directly the index.php page with the configuration of your php you managed to configure and to interpret php.
You can begin to install your site.
To put files in your Web server it will be directly there inside:
Quote:
/usr/local/www/apache22/data/
I hope that this tutoriel will have you more and will have you learnt sure things of which the functioning of a Web server and its installation.
We shall see in another tutoriel the installation of phpMyAdmin and the reassurance of its server.