Rebuild da versão Moss @ new debian server ''

Instalar Apache.

sudo apt-get install apache2​

  • Editar o apache2.conf para alterar as configs.

sudo nano /etc/apache2/apache2.conf

  • Para opitimizar a performace do apache alterar os seguintes parametros.

StartServers 1 MinSpareServers 3 MaxSpareServers 6 MaxClients 24 MaxRequestsPerChild 3000

  • Reeniciar o Apache.

sudo service apache2 restart

Configurar os Virtual Hosts

  • Desactivar o virtual host padrão do apache:

sudo a2dissite default

  • Ir para a home

cd ~

  • Criar pasta publica

mkdir public

  • Criar pasta do projecto com logs, backup, public

mkdir -p public/ruifigueiredo.me/moss/{public,log,backup}

  • Alterar as permissões da pasta public

sudo chmod -R a+rx ~/public

  • Criar o ficheiro do virtual host

sudo nano /etc/apache2/sites-available/ruifigueiredo.me

  • Criar ficheiro do virtual host:

# domain: example.com
# public: /home/example_user/public/example.com/
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@example.com
ServerName www.example.com
ServerAlias example.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /home/example_user/public/example.com/public
# Log file locations
LogLevel warn
ErrorLog /home/example_user/public/example.com/log/error.log
CustomLog /home/example_user/public/example.com/log/access.log combined
</VirtualHost>

  • Criar o symbolic link para a pasta public

sudo a2ensite ruifigueiredo.me

  • Restart do apache

sudo service apache2 restart

Tags: