Skip to content

iafi01/ft_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 

Repository files navigation

ft_server liafigli.42

FT_SERVER

DEL CACHE: docker system prune -fa


Reloadda sempre i plug-in che modifichi (mysql, php7.3-fpm, nginx)


docker run -p 80:80 -p 443:443 -it --name ciao debian:buster


apt-get update

apt install nginx -y


service nginx start


service --status-all
apt install mariadb-server mariadb-client -y
service mysql start
service mysql status || mysqladmin version
apt-get -y install php7.3-fpm php7.3-common php7.3-mysql php7.3-gmp php7.3-curl php7.3-intl php7.3-mbstring php7.3-xmlrpc php7.3-gd php7.3-xml php7.3-cli php7.3-zip php7.3-soap php7.3-imap
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt -subj "/C=IT/ST=Roma/L=Roma/O=42ROMALUISS/OU=liafigli/CN=42roma"
IT, ROMA, ROMA, 42ROMALUISS, 42ROMALUISS, liafigli, lorenzoiafigliola@gmail.com

cd etc/nginx/sites-available/
apt install vim
vim default
server {
  listen 80 default_server;
  listen [::]:80 default_server;
  return 301 https://$host$request_uri;
}
server{
  listen 443 ssl default_server;
  listen [::]:443 ssl default_server;
  ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
  ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
  ssl_session_tickets off;
//senza chiudere la parentesi

nginx -t
service nginx restart
apt install wget
cd ../../../var/www/html
wget https://files.phpmyadmin.net/phpMyAdmin/4.9.0.1/phpMyAdmin-4.9.0.1-all-languages.tar.gz
tar -xvzf phpMyAdmin-4.9.0.1-all-languages.tar.gz

//decommenta queste due righe

location ~ .php$ {
  include snippets/fastcgi-php.conf;
  fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}


Cancella index.nginx-debian.html dal default
mv phpMyAdmin-4.9.0.1-all-languages/ pma
Vai su localhost/pma
mysqladmin -u root password 'your_password'
accedi con 'root' e 'your_password
wget https://wordpress.org/latest.tar.gz
tar -xvzf latest.tar.gz
cd wordpress
cp wp-config-sample.php wp-config.php
mysql -u root -p
vim wp-config.php
CREATE DATABASE liafigli;
CREATE USER 'liafigli'@'localhost' identified by 'liafigli';
GRANT ALL PRIVILEGES ON liafigli.* TO 'liafigli'@'localhost';
FLUSH PRIVILEGES;
EXIT;
MODIFICA: define( 'DB_NAME', 'liafigli' );
define( 'DB_USER', 'liafigli' );
define( 'DB_PASSWORD', 'liafigli' );
define( 'DB_HOST', 'localhost' );

Setta wordpress come predefinita chown -R www-data:www-data /var/www/html/wordpress

Running Dockerfile
docker system prune -fa
docker build -t ciao .
docker run -p 80:80 -p 443:443 -it --name ciao ciao

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published