Added methods for Installing PHP and configuring Virtual Hosts in Apache (#26359)

* Added Basic Configuration Settings for apache

* Added More Methods of Installing PHP on Windows and Ubuntu
pull/27016/head^2
Ashutosh Kumar 2018-12-18 23:05:17 +05:30 committed by Christopher McCormack
parent 28c02d4b24
commit 6816c92620
2 changed files with 26 additions and 12 deletions

View File

@ -61,12 +61,27 @@ The `-R` flag will cause grep to search recursively through the `/etc` directory
/etc/httpd/conf/httpd.conf DocumentRoot /var/www/html /etc/httpd/conf/httpd.conf DocumentRoot /var/www/html
``` ```
### Resources ## Basic Configuration
If you want to host multiple domains on a single server, you can configure Virtual Hosts in Apache.
#### Installation and Configurations Guides You can copy the `default.conf` and modify accordingly in the following directory:
#### On Ubuntu:
```sh
/etc/apache2/sites-enabled/
```
#### On Centos:
```sh
/etc/httpd/sites-enabled/
```
## Resources
### Installation and Configurations Guides
- [Ubuntu](https://tutorials.ubuntu.com/tutorial/install-and-configure-apache#2) - [Ubuntu](https://tutorials.ubuntu.com/tutorial/install-and-configure-apache#2)
- [CentOS](https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-apache-config-ui.html) - [CentOS](https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-apache-config-ui.html)
- [Arch Linux](https://wiki.archlinux.org/index.php/Apache_HTTP_Server) - [Arch Linux](https://wiki.archlinux.org/index.php/Apache_HTTP_Server)
#### Getting Started Guides ### Getting Started Guides
- [Getting Started with Apache HTTP Server Version 2.5](https://httpd.apache.org/docs/trunk/getting-started.html) - [Getting Started with Apache HTTP Server Version 2.5](https://httpd.apache.org/docs/trunk/getting-started.html)

View File

@ -8,8 +8,7 @@ Any computer! PHP is very versatile and can run in many different environments.
### Manual Install: ### Manual Install:
**Windows** #### Windows
1. Download the zip from [windows.php.net/download](https://windows.php.net/download#php-7.2) and unzip it (ex `C:\PHP`) 1. Download the zip from [windows.php.net/download](https://windows.php.net/download#php-7.2) and unzip it (ex `C:\PHP`)
2. Add php to the windows PATH (for example append `;C:\PHP`) 2. Add php to the windows PATH (for example append `;C:\PHP`)
3. Copy and rename either `php.ini - development` or `php.ini - production` to `php.ini` 3. Copy and rename either `php.ini - development` or `php.ini - production` to `php.ini`
@ -18,13 +17,13 @@ If you are using IIS for your webserver, this is a good resource:
- [Microsoft Docs - Windows installation and integration with IIS](https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-1-install-iis-and-php#12) - [Microsoft Docs - Windows installation and integration with IIS](https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-1-install-iis-and-php#12)
**Mac** #### MacOS
_Type the commands in a terminal_ _Type the commands in a terminal_
1. Install homebrew `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"` 1. Install homebrew `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
2. Install php `brew install php` 2. Install php `brew install php`
**Linux** #### Linux
This varies a bit with each distro This varies a bit with each distribution
- _debian/ubuntu_ `sudo apt-get install php -y` - _debian/ubuntu_ `sudo apt-get install php -y`
- _fedora/rhl/centos_ `dnf install php php-common` - _fedora/rhl/centos_ `dnf install php php-common`
@ -35,10 +34,10 @@ There are many good resources for this, like:
- [Digital Ocean - How to install the LEMP stack on Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04) - [Digital Ocean - How to install the LEMP stack on Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04)
### Install Bundles ### Install Bundles
There are also several popular install bundles for PHP technology stacks which are multi platform. There are also several popular install bundles for PHP technology stacks which are multi-platform.
- [XAMPP Installer - Apache Server, MariaDB, PHP, and Perl](https://www.apachefriends.org/index.html) _window, linux, macOS_ - [XAMPP Installer - Apache Server, MariaDB, PHP, and Perl](https://www.apachefriends.org/index.html) _window, linux, macOS_
- [MAMP Webserver](https://www.mamp.info) _windows, macOS_ - [MAMP Webserver](https://www.mamp.info) _windows, macOS_
- [WAMP Server](http://www.wampserver.com/en/) _windows_
### Find a webhost with free PHP services. ### Find a webhost with free PHP services.
It is [common](https://www.google.com/search?q=free+php+web+hosting) for free webhosting services to offer support for PHP. It is [common](https://www.google.com/search?q=free+php+web+hosting) for free webhosting services to offer support for PHP.
@ -46,7 +45,7 @@ It is [common](https://www.google.com/search?q=free+php+web+hosting) for free we
## Once PHP is installed: ## Once PHP is installed:
If you installed PHP with a webserver, often a default route is set for `localhost/info.php` or `127.0.0.1/info.php`. If PHP has been integrated properly, it should display a description of the current PHP installation. If your server will be public, you should delete `info.php` as it contains private details about your installation, system. If you installed PHP with a webserver, often a default route is set for `localhost/info.php` or `127.0.0.1/info.php`. If PHP has been integrated properly, it should display a description of the current PHP installation. If your server will be public, you should delete `info.php` as it contains private details about your installation, system.
If you did not install PHP with a webserver, several tools integrate well with the library for the ability to locally run, debug, host your PHP scripts and applications. [VS Code's](https://code.visualstudio.com/) extention [PHP Server](https://marketplace.visualstudio.com/items?itemName=brapifra.phpserver) allows your to develop and host locally. If you did not install PHP with a webserver, several tools integrate well with the library for the ability to locally run, debug, host your PHP scripts and applications. [VS Code's](https://code.visualstudio.com/) extension [PHP Server](https://marketplace.visualstudio.com/items?itemName=brapifra.phpserver) allows your to develop and host locally.
### Resources ## Resources
- The official PHP website (PHP.net) has installation instructions for PHP: http://php.net/manual/en/install.php - The official PHP website (PHP.net) has installation instructions for PHP: http://php.net/manual/en/install.php