![]() ![]() We want to tell our web server to prefer PHP files, so we’ll make Apache look for an index.php file first. ![]() ![]() Currently, if a user requests a directory from the server, Apache will first look for a file called index.html. In most cases, we’ll want to modify the way that Apache serves files when a directory is requested. This should install PHP without any problems. We’re going to include some helper packages as well: sudo apt-get install php7 libapache2-mod-php7 php7-mcrypt We can once again leverage the apt system to install our components. It can run scripts, connect to our MySQL databases to get information, and hand the processed content over to our web server to display. PHP is the component of our setup that will process code to display dynamic content. This will remove some sample users and databases, disable remote root logins, and load these new rules so that MySQL immediately respects the changes we have made.Īt this point, your database system is now set up and we can move on. If you are happy with your current password, type “n” for “no” at the prompt.įor the rest of the questions, you should simply hit the “ENTER” key through each prompt to accept the default values. Next, it will ask you if you want to change that password. You will be asked to enter the password you set for the MySQL root account. Start the interactive script by running: sudo mysql_secure_installation You can do this by typing: sudo mysql_install_dbĪfterwards, we want to run a simple security script that will remove some dangerous defaults and lock down access to our database system a little bit. When the installation is complete, we need to run some additional commands to get our MySQL environment set up securely.įirst, we need to tell MySQL to create its database directory structure where it will store its information. Think of it as being similar to the root account for the server itself (the one you are configuring now is a MySQL-specific account however). This is an administrative account in MySQL that has increased privileges. The package index on our computer should already be up-to-date.ĭuring the installation, your server will ask you to select and confirm a password for the MySQL “root” user. This is because we recently ran it in the commands above to install Apache. Note: In this case, you do not have to run sudo apt-get update prior to the command. This time, we’ll also install some other “helper” packages that will assist us in getting our components to communicate with each other: sudo apt-get install mysql-server php5-mysql Basically, it will organize and provide access to databases where our site can store information.Īgain, we can use apt to acquire and install our software. Now that we have our web server up and running, it is time to install MySQL. If you see this page, then your web server is now correctly installed. You will see the default Ubuntu 17.04 Apache web page, which is there for informational and testing purposes. You can do a spot check right away to verify that everything went as planned by visiting your server’s public IP address in your web browser (see the note under the next heading to find out what your public IP address is if you do not have this information already): localhost It will ask you for your regular user’s password to verify your intentions.Īfterwards, your web server is installed. Since we are using a sudo command, these operations get executed with root privileges. You can learn more about how to use apt here.įor our purposes, we can get started by typing these commands: sudo apt-get update A package manager allows us to install most software pain-free from a repository maintained by Ubuntu. We can install Apache easily using Ubuntu’s package manager, apt. The Apache web server is currently the most popular web server in the world, which makes it a great default choice for hosting a website.
0 Comments
Leave a Reply. |