Mysql ve Php5 destekli Apache2 Kurulumu (CentOS 6.1)

Bu yazımızda LAMP kurulumunu ve gelişmiş tanımlama işlemlerine bakacağız. LAMP ( Linux Apache Mysql, PHP) kelimelerinin kısa yazılışıdır aslında ve genelde bu şekilde telaffuz edilir… Kuruluma Mysql ile başlıyoruz;

[php] yum install mysql mysql-server [/php]

Mysql kurulumundan sonra mysql servisiyle ilgili işlemlerimi yapalım. ( Başlangıçta otomatik olarak başlamasını sağlıyoruz)

[php]
chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start
[/php]

Daha sonra mysql için root kullanıcı şifresi oluşturuyoruz

[php]
# mysql_secure_installation
Set root password? [Y/n] <– ENTER
New password: <– Root şifresi giriniz.
Re-enter new password: <– Root şifresini tekrar giriniz.
Password updated successfully!
Reloading privilege tables..
… Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] <– ENTER
… Success!

Normally, root should only be allowed to connect from ‘localhost’.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] <– ENTER
… Success!

By default, MySQL comes with a database named ‘test’ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] <– ENTER
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] <– ENTER
… Success!

Cleaning up…

All done!  If you’ve completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

[root@server1 ~]#
[/php]

Ve Apache kuruluma geçebiliriz.

[php]
yum install httpd
[/php]

Apache servis tanımlamalarını yapalım

[php] chkconfig –levels 235 httpd on [/php]

Servisi başlatalım

[php] /etc/init.d/httpd start [/php]

Servis başladıktan sonra Apache’nin çalışıp çalışmadığını browser’dan çağırarak kontrol edebilirsiniz ya da lütfen ediniz 🙂
Apache’de varsayılan olarak  /var/www/html klasörü tanımlıdır. ( Web klasörü ) ayar dosyaları içinse /etc/httpd/conf/httpd.conf dosyasını okur. Ek ayar dosyaları içinse /etc/httpd/conf.d/ bakmanız gerekir.

PHP kurulumuna geçebiliriz.
[php] yum install php [/php]

Php kurulumundan sonra Apache servisini restart etmekte fayda var.
[php] /etc/init.d/httpd restart [/php]

Php Mysql desteği :
Mysql desteği için php-mysql paketini kurabiliriz.

Öncelikle php modüllerine göz atalım.
[php] yum search php [/php]

İhtiyaç duyulan php modüllerinin kurulumunu yapalım.
[php] yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc [/php]

Ve yine apache servisini restart etmekte fayda var.
[php] /etc/init.d/httpd restart [/php]

Tüm kurulumları tamamladık. isterseniz kurulumu kontrol etmek için http://sunucu ip’si/info.php adresine göz atabilirsiniz.

Ayrıca Phpmyadmin kurulumunu farklı bir dökümanda anlatmak istiyorum.

Kolay gelsin.
 

Yorum yapın

This site uses Akismet to reduce spam. Learn how your comment data is processed.