![]() You have to enable Apache to serve web requests on port 80 and port 443 in your firewall. If you did not see the above image don’t worry, you might have enabled the firewall. This command prints the public IP address of your VPS. Important! If you don’t know your VPS’s IP address, the quickest way to find it is by running following the command. You should see a page that looks like this: For example, if your VPS IP address is 0.0.0.0 your address should be: To check the installation, open your browser on your local machine and enter the following address in address bar. Now install Apache2 with the following command sudo apt-get install apache2 Checking Your Installation Step 1 – Installing Apache Web Serverīefore beginning the installation, update your system and make sure you have latest packages. This whole process is executed with some variations every single time when you request a web page from a LAMP server. Apache, our web server sends this generated web page to the client. It executes the logic written in that file, pulls data from the MySQL database if needed and generates a web page. Apache looks for the file being requested in the URL of the request and passes this information to the PHP interpreter. Whenever a web page request arrives at a server it is passed on to an application called web server, in our case Apache. Hosted virtual server running Ubuntu 16.04.A local machine with SSH client installed (see tutorial on how to use putty ssh client if you are Windows user).Step 3.1 – Checking your PHP Installationīefore you begin with Ubuntu LAMP tutorial, you will need the following:.In conclusion the overall solution was to adapt the code in my files to the Ubuntu system. The solution was to change the password to something simple, as 12345. The problem, this time was that the password had special characters. main/dbconnect.phpģ.After this I got a new error, about the connection to the SQL database: Warning: mysqli_connect(): (HY000/1045): Access denied for user (using password: YES) in /var/Access denied for user (using password: YES) The solution for this was to add a dot in front of the path. Warning: require_once(/main/dbconnect.php): failed to open stream: No such file or directory in /var/(include_path='.:/usr/share/php') in /var/www/html/index.php on line 7 Probably due to the differences between Windows and Ubuntu. So I added this in my index.php: error_reporting(E_ALL) Ģ.The first error I got was about the path to other php files. So the first thing you should do is activate php errors. So the problem must have been the code inside index.php. I will add all steps I took, just in case it will help someone else when moving from Windows to Ubuntu.ġ.There was no reason why my website shouldn't have worked. To activate the new configuration, you need to run: On Ubuntu I installed the older version 5.6 and changed it for Apache also: sudo a2enmod php5.6Ĭonsidering dependency mpm_prefork for php5.6:Ĭonsidering conflict mpm_event for mpm_prefork:Ĭonsidering conflict mpm_worker for mpm_prefork: I went back on windows and changed the version in WAMP to a newer one, and my website stopped working there also, obviously. I realized that on Windows I was using an older version of PHP, more exactly: PHP 5.6. I have set the user and group in etc/apache2/envvars but it still doesn't work: export APACHE_RUN_USER=mihail-cosmin Index.php which doesn't work, belongs to my user and group Index.html and info.php work, they belong to user and group root. rwxrwxrwx 1 mihail-cosmin mihail-cosmin 3931 /var/www/html/index.php Ls -la /var/www/html/in* will list 3 files I have: -rw-r-r- 1 root root 10918 Jul 21 19:18 /var/www/html/index.html # vim: syntax=apache ts=4 sw=4 sts=4 sr noet The file /etc/apache2/mods-enabled/dir.conf has the below content: ĭirectoryIndex index.php index.html index.cgi index.xhtml index.htm ![]() I have put all required files in the var/Is there anything else I have to do to be able to load my website? Recently I moved to Ubuntu, so I installed LAMP and all looks fine: localhost in browser shows the Apache2 Ubuntu Default Page.Ĭreated an info.php file with the content: Īccessing the file with in the browser works and displays the php info.īut trying to access my website with doesn't load the website. I have a website that works without problems in WAMP.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |