Skip to content

Latest commit

 

History

History
159 lines (118 loc) · 1.88 KB

LAMP.md

File metadata and controls

159 lines (118 loc) · 1.88 KB

Ubuntu 16.04 LAMP installation.

Firewall (UFW)

sudo apt install ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw enable
sudo ufw allow http
sudo ufw allow 80

sudo ufw allow https
sudo ufw allow 443

sudo ufw allow ftp
sudo ufw allow 21/tcp
sudo ufw status verbose

Apache

sudo apt update
sudo apt install apache2
sudo vim /etc/apache2/apache2.conf
...
ServerName SİZİN_ALAN_ADINIZ_VEYA_IP_ADRESİNİZ
...
sudo apache2ctl configtest
# Çıktı:
Syntax OK
sudo ufw app list
# Çıktı:
Available applications:
  Apache
  Apache Full
  Apache Secure
  OpenSSH
sudo ufw app info "Apache Full"
# Çıktı:
Profile: Apache Full
Title: Web Server (HTTP,HTTPS)
Description: Apache v2 is the next generation of the omnipresent Apache web
server.

Ports:
  80,443/tcp
sudo ufw allow in "Apache Full"
http://SİZİN_ALAN_ADINIZ_VEYA_IP_ADRESİNİZ

MySQL kurulumu:

sudo apt-get install mysql-server
sudo mysql_secure_installation

PHP

sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
sudo vim /etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

phpMyAdmin

sudo apt-get install phpmyadmin php-mbstring php-gettext
sudo phpenmod mcrypt
sudo phpenmod mbstring
sudo systemctl restart apache2
sudo systemctl status apache2
http://SİZİN_ALAN_ADINIZ_VEYA_IP_ADRESİNİZ/phpmyadmin

Basit php sitesi

sudo vim /var/www/html/info.php
<?php
phpinfo();
?>

http://SİZİN_ALAN_ADINIZ_VEYA_IP_ADRESİNİZ/info.php
sudo rm /var/www/html/info.php