Remove the test file: sudo rm /var/Troubleshooting If not, the output will be an error message. If the components of your LAMP stack are working correctly, the browser will display a “Connected successfully” message. Navigate to /phptest.php from your local machine. If ( ! $conn ) echo 'Connected successfully' ?> $conn = mysqli_connect ( $servername, $username, $password ) // Check connection - if it fails, output will include the error message $servername = "localhost" $username = "webuser" $password = "password" // Create MySQL connection PHP Test Hello World' // In the variables section below, replace user and password with your own MySQL credentials as created on your server Enter the document root path and log directories as shown below, and add a Directory block before : Uncomment the ServerName option and update it with your domain. Open the new configuration file in your text editor. For each of these steps, replace with your domain name.Ĭreate a copy of the default Apache configuration file for your site: sudo cp /etc/apache2/sites-available/nf /etc/apache2/sites-available/ You can set up virtual hosts several ways, and the following steps outline the recommended method. Restart Apache: sudo systemctl restart apache2 To allow incoming HTTP and HTTPS traffic for Apache Full profile: sudo ufw allow in "Apache Full"ĭisable the event module and enable prefork: sudo a2dismod mpm_event Ports 80 and 443 should be listed as enabled for Apache Full profile.ī. Check the ports that are enabled for Apache Full Profile: sudo ufw app info "Apache Full" This guide lists the commands to enable web traffic if you configured UFW on your server.Ī. StartServers 4 MinSpareServers 3 MaxSpareServers 40 MaxRequestWorkers 200 MaxConnectionsPerChild 10000 Įnable the firewall to allow web traffic. Open the nf Apache config file and adjust the KeepAlive setting: This is done by allowing Apache to reuse connections, instead of opening a new connection for every request. KeepAlive makes a website faster if the host has enough memory to support it. The KeepAlive setting allows Apache to better utilize server-side memory, reducing latency for users on the hosted site. Optionally, install additional cURL, JSON, and CGI support: sudo apt install php-curl php-json php-cgi Install PHP, the PHP Extension and Application Repository, Apache support, and MySQL support: sudo apt install php libapache2-mod-php php-mysql Install the mysql-server package: sudo apt install mysql-server Install Apache 2.4 from the Ubuntu repository: sudo apt install apache2 If you prefer not to install the bundled packages via Tasksel, you can instead install them separately: Use Tasksel to install the LAMP stack: sudo tasksel install lamp-server Install Tasksel if not already installed by default: sudo apt install tasksel Instead of installing Apache, MySQL, and PHP separately, Tasksel offers a convenient way to get a LAMP stack running quickly. If you do not have a registered domain name, then replace with the IP address of the Linode server in the following instructions. Once installed run sudo cp /etc/phpmyadmin/nf /etc/apache2/conf-available/phpmyadmin.If you have a registered domain name for your website, then add the domain to the Linode server on which you plan to install the LAMP stack. Once done restart the service sudo systemctl restart rviceĮxit Install Phpmyadmin sudo apt install phpMyAdminĬonfigure database for phpmyadmin with dbconfig-common? Remove test database and access to it? : Y When prompted, answer the questions below by following the guide.Įnter current password for root (enter for none): Just press the Enter Setup the installation sudo mysql_secure_installation Once done - run this commands sudo systemctl stop rvice Once done - restart the apache server sudo systemctl restart apache2Ĭheck php version installed using php -v Install MariaDB sudo apt install mariadb-server mariadb-client Install few necessary extensions sudo apt install php7.3-cli php7.3-fpm php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json Install PHP 7.3 sudo apt-get install php7.3 Once apache installation done - run this commands sudo systemctl stop rvice
0 Comments
Leave a Reply. |