Posted on May 20, 2016.
Running your own server may be useful for many reasons. Currently, I run my own server to host my course databases and web applications. I recently updated to the latest version and ran into issues where I had to step through the whole setup process again. Since it took me way longer than I hoped, I documented the whole process in case I have to do it again. Here are the steps:
Downloading and Installing WAMPServer (WAMP)
- Download WAMP here: http://www.wampserver.com/en/ (Note: my instructions will be for installing WAMPServer 3 – 64 bit & PHP 5.6.15 & PHP 7)
- Install WAMP using the recently downloaded file. You may need to install the Visual C++ Distributable located here: https://www.microsoft.com/en-us/download/details.aspx?id=48145
- Restart your computer.
- Start WAMP.
Configuring Remote Connection to Your Server
- Be sure you have your server assigned a static IP address.
- Open your httpd.conf file by clicking on the WAMP icon in right side of your taskbar. Select Apache and then httpd.conf.
- Find and replace the following lines:
<Directory />
AllowOverride none
Require all denied
</Directory>
With:
<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory> - Find and replace the following lines:
<Directory "C:/wamp64/www/">
...
Require local
</Directory>
With:
<Directory />
...
Allow from all
</Directory>
- Your server should now be accessible remotely using your static IP address.
Configuring Access to Your Database
- Open your my.ini file by clicking on the WAMP icon in the right side of your taskbar, select MySQL, and then my.ini.
- At the very end of the my.ini document add the following line (replace [server’s IP address] with your server’s static IP address):
bind-address = [server's IP address]
- Click the WAMP icon in the right side of your taskbar and select phyMyAdmin.
- Login using root as the username and leave the password blank.
- Immediately change the root password by clicking the User Accounts tab.
- Locate the root account and click Edit privileges.
- Click Change password near where you clicked on the User Accounts tab.
- Type in your new password twice and then click Go. You will need to log back in after changing your password.
- Next, I recommend that you add an administrative user (leave the root user alone) by doing the following:
- Click the User Accounts tab again.
- Click Add user account.
- Type the new user in the User name and Password fields.
- Be sure to define where this user can connect from. If you want this user to access from any location, leave the % as default.
- Select whether you will create a database for this user (i.e. Create database with same name and grant all privileges).
- Determine what privileges this user will have (e.g. Grant all privileges on wildcard name (username\_%)).
- Decide whether the user will have global privileges or certain privileges as desired.
- Click Go when you are finished. Repeat for any other users.
Configuring Your Website
- Locate the www directory (by default it is found at C:wamp64www) and drop all your web files there.
- You should now be able to view your website by navigating to your server’s IP address in a browser.
Configuring SMTP for Sending Emails
- Download the php_smtp.dll here: http://www.topdll.com/download/php_smtp.dll
- Save this file to C:wamp64inphpphp5.6.16ext.
- Edit the php.ini file under the dynamic extensions to include the following:
extension=php_smtp.dll
- Restart the server and your SMTP server should be ready to go.
- Additionally, you can download PHPmailer to help with sending emails.
Configuring the Server Timezone
- In the php.ini file, change the following line:
date.timezone = "UTC"
To:
date.timezone = "US/Central"
- Note: be sure to change the timezone to the correct one unless you live in the central timezone.
Configuring File Upload Size and Total Uploads
- In the php.ini file, change the following line:
upload_max_filesize = 2M
To:
upload_max_filesize = [desired max upload size]
- In the php.ini file, change the following line:
max_file_uploads = 20
To:
max_file_uploads = [desired max uploads]
Configuring InnoDB
When I queried the information_schema metadata, I wanted to see how the foreign keys of one table are related to other tables. To do this, I made the following change:
- Open the my.ini file by clicking the WampServer icon, then MySQL, then my.ini.
- Find the following line:
default-storage-engine=MYISAM
Change it to:
default-storage-engine=INNODB
Configuring Mongo
- Find and download the php_mongo.dll.
- Save this file to C:wamp64inphpphp5.6.16ext.
- Edit the php.ini file under the dynamic extensions to include the following:
extension=php_mongo.dll
- Restart the server and you should now be able to use PHP with Mongo.
Configuring Oracle
- Find and download the php_oci8_11g.dll.
- Save this file to C:wamp64inphpphp5.6.16ext.
- Edit the php.ini file under the dynamic extensions to include the following:
extension=php_oci8_11g.dll
- Enable the following extension too:
extension=php_pdo_oci.dll
- Restart the server and you should now be able to use PHP with Oracle.