Toggle navigation

WAMPServer Image Guide

Version 3.1.0

Websoft9 WAMPServer stack is a pre-configured, ready to run image for running PHP application on Alibaba Cloud.

WampServer is a Windows web development environment. It allows you to create web applications with Apache2, PHP and a MySQL database. Alongside, PhpMyAdmin allows you to manage easily your databases.

These components are included in WAMPServer Stack of Image:

Infrastructur(PHP 7.0.23/7.1.9/5.6.31,Apache 2.4.27)
PHP version can be switched smoothly
PHP configure file directory: C:\websoft9\wampserver\bin\apache\apache2.4.*\bin\php.ini
Apache vhost file: C:\websoft9\wampserver\bin\apache\apache2.4.*\conf\extra\httpd-vhosts.conf
Log file:please view it from WAMPServer panel

Database(MySQL5.7.19)
MySQL directory: C:\websoft9\wampserver\bin\mysql
MySQL configure file: C:\websoft9\wampserver\logs\mysql.log
The account of database please refer to: Will be used Usernames and Passwords
Mysql Panel:http://Inernet IP/phpmyadmin

After the installation of Image,please verify it

  • Login on Alibaba Cloud console,get you Internet IP Address
  • Open you Chrome or Firefox on your local PC,visit the http://Internet IP Address and you can enter the WAMPServer hompage directly,if there no response from browser,please check the Security Group settings to ensure that port 80 is been allowed

Two usernames and passwords are required for application installation, application using, and application maintenance:

  1. MySQL:Default username and password is root/123456
    Control Panel URL:http://Internet IP Address/phpmyadmin
  2. Windows Server:Username is administrator,Password is set by youself when buying.
    Please Using the Microsoft Terminal Services Client (MSTSC)  on you local PC

Note:You can reset the password of OS through Cloud Console if you have forgotten it

There five steps for deploy application on IIS:
① upload site source code->② Cofigue Domain Name(not nessesary)->③ add database for application(not nessesary)->⑤ start the installation of your application

Note:one application or multiple applications on IIS?use domain or not use domain?Please select the corresponding deployment solution below

Solution1: only one application deployment

If you just want to only one application deployment on Server,following are the steps:

  1. User Desktop Remote tools to connect to Windows Server,copy the source code to Root directory
  2. If you dont’s have domain for this application,please use browser to visit: http://Internet IP to start the installation
  3. If you have domain,please complete the domain setting first  (refer to How to set Domain Name?),then use browser to visit: http://domain to start the installation
  4. Some time you application need to create database and account setting before installation,you should us phpMyAdmin to do that(refer to How to access phpMyAdmin?)

The default Root directory is:  C:\websoft9\wampserver\www

Solution2: multiple applications deployment(no domain)

No domain and need install more than one application,following are the steps:

  1. User Desktop Remote tools to connect to Windows Server,copy the source code to Root directory and create a new directory on Root directory for this application,e.g “newproject1”
  2. Open Apache->Alias directories->Add an alias
  3. Add alias for this application
  4. Modify the vhost file for newproject1(C:\websoft9\wampserver\alias\newproject1.conf),replace “Require local” for “Require all granted” then you turn on the remote access
  5. Click the “Restart all services” on the WAMP menu
  6. please use browser to visit: http://Internet IP/newproject1 to start the installation
  7. Some time you application need to create database and account setting before installation,you should us phpMyAdmin to do that(refer to How to access phpMyAdmin?)

Deploy the second application newproject2,then same steps

The default Root directory is:  C:\websoft9\wampserver\www

Solution3: multiple applications deployment(one domain)

One domain and need install more than one application,following are the steps:

  1. Complete the domain setting first  (refer to How to set Domain Name?)
  2. User Desktop Remote tools to connect to Windows Server,copy the source code to Root directory and create a new directory on Root directory for this application,e.g “newproject1”
  3. Open Apache->Alias directories->Add an alias
  4. Add alias for this application
  5. Modify the vhost file for newproject1(C:\websoft9\wampserver\alias\newproject1.conf),replace “Require local” for “Require all granted” then you turn on the remote access
  6. Click the “Restart all services” on the WAMP menu
  7. please use browser to visit: http://domain/newproject1 to start the installation
  8. Some time you application need to create database and account setting before installation,you should us phpMyAdmin to do that(refer to How to access phpMyAdmin?)

Deploy the second application newproject2,then same steps

The default Root directory is:  C:\websoft9\wampserver\www

Solution4: multiple applications deployment(multiple domain)

Muliple domain it mean each one application need one domain.e.g your domain is www.websoft9.com,following are the steps:

  1. Complete the domain setting first  (refer to How to set Domain Name?)
  2. User Desktop Remote tools to connect to Windows Server,create a new directory on Root directory for this application,e.g “newproject1”
  3. Copy your source code to folder newproject1
  4. Open the “create vhost” on the menu of WAMPServer
  5. Refer to the picture above,fill in the domain name and directory(The format can not be wrong, otherwise the creation will fail),then start the creation of the VirtualHost
  6. You can see the successul information below if correct
  7. Modify the vhost file for newproject1(C:\websoft9\wampserver\alias\newproject1.conf),replace “Require local” for “Require all granted” then you turn on the remote access,save it
  8. Click the “Restart all services” on the WAMP menu
  9. please use browser to visit: http://domain/ to start the installation
  10. Some time you application need to create database and account setting before installation,you should us phpMyAdmin to do that(refer to How to access phpMyAdmin?)

Deploy the second application newproject2,then same steps

The default Root directory is:  C:\websoft9\wampserver\www

 

You should known that for Windows OS, use Management Terminal or Microsoft Terminal Services Client (MSTSC).

Connect to a Windows instance using Windows OS

Using a local Windows OS, connect to a Windows instance using one of the following:

  • Microsoft Terminal Services Client (MSTSC)
    This method is available only if you purchased bandwidth when creating your instance. Prior to using this method, ensure the instance can be accessed through the Internet.
  • Management Terminal (VNC)
    Connection through the Management Terminal can be completed disregarding whether bandwidth has been purchased.

Use MSTSC

  1. Perform one of the following to start Remote Desktop Connection:
    • Click Start > Remote Desktop Connection.
    • Click the Start icon and enter mstsc in the search box.
    • Press the shortcut key Windows Logo + R to open the Run window, enter mstsc, and then press the Enter key.
  2. In the Remote Desktop Connection dialog box, enter the public IP address of the instance. Click Show Options.
    1
  3. Enter the user name. The default value is Administrator. Check Allow me to save credentials. In this way, you do not need to manually enter the password again when you log on later.
    2
  4. (Optional) If you want to copy text or files from your computer to the instance, click the Local Resources tab to see options for sharing local computer resources.
    • If you need to copy text only, check Clipboard.
    • If you need to copy files from your computer as well, click More > Drives, and select drives where you want to copy files to your instance.
      1
      1
  5. (Optional) Open the Display tab to resize the remote desktop window. Full Screen is recommended.
    1
  6. Click the Connect button to complete connection to the instance.

When you connect your computer to the Windows instance successfully, you can operate the instance from your computer.

Following is the step for access phpMyadmin

  1. Open Chrome or Firefox on your local PC
  2. visit the http://Internet IP Address/phpMyAdmin,you can enter the login page
  3. select you language,Username:root,Password:123456
  4. Click the button “Go”

If you have modify the configuration,please restart the services

  • Solution1:Remote to Windows Server and left click the icon WAMPServer on the Taskbar of Windows
  • Solution2:“Start”-> “administrator tools”->“services”,restart the wampapache64,wampMysql

Modify php configuration is very easy on WAMPServer,because it’s a visual configuration interface. Left click the “W icon” on the Windows taskbar,you can start most of the configuration:

Before setting https, please make sure the port 443 is allowed in the  server security group. If it is not enabled, https access is unavailable.

HTTPS Settings(First of all, be prepared for ca)

You can refer to these steps if you have a CA(please make sure your CA is useful):

  1. DownlodWin64OpenSSLto your Server,intall it
  2. Copy the files on the bin directory(don’t need to copy the directory of bin) of Wind64OpenSSL to C:\websoft9\wampserver\bin\apache\apache2.4.23\bin
  3. Enable the ssl module on Apache of WampServer
  4. Copy the CA to the directory C:\websoft9\wampserver\apps\cert (your can create the cert directory if it not exsit )
  5. Open the configuration file:httpd-vhosts.conf
  6. Add the https configuration below to httpd-vhosts.conf file(please reserve the already exsiting content),then save it
    Listen 443
    <VirtualHost *:443>
    ServerName  www.mydomain.com
    DocumentRoot "C:/websoft9/wampserver/www"
    <Directory "C:/websoft9/wampserver/www">
    Options Indexes FollowSymlinks
    AllowOverride All
    Require all granted
    </Directory>
    SSLEngine on
    SSLCertificateFile  "C:/websoft9/wampserver/apps/cert/cert.pem"
    SSLCertificateKeyFile  "C:/websoft9/wampserver/apps/cert/key.pem"
    SSLCertificateChainFile  "C:/websoft9/wampserver/apps/cert/chain.pem"
    </VirtualHost>
  7. Modify the information related to you,then save it
    ServerName  #main domain
    DocumentRoot # apps directory,e.g:C:/websoft9/wampserver/www/wordpress
    Directory #apps directory
    SSLCertificateFile
    SSLCertificateKeyFile
    SSLCertificateChainFile
  8. Restart the service

FAQ for apply CA

Precautions for apply the CA:

  • Most of the time,free CA is used on the detailed domain name,e.g: buy.example.com,next.buy.example.com
  • example.com Is a wildcard domain name and cannot be used to apply for a free certificate
  • You should complete the Domain Name Resolution before apply the CA,because the CA will binding the IP.If you change the DNS,the CA is unavailable

You need do complete two steps on this ASP.NET Stack for using Domain Name to visit your site:

Step1: Domain Name Resolution

Domain Name Resolution indicates the way your domain names are resolved to their mapped IP address. The majority of resolutions from domain names to IP addresses are done through a procedure called DNS. After the resolution, the domain name can be used to access Internet in a much more convenient way.

You can use Alibaba Cloud DNS in sync with the Domain service. Alibaba Cloud DNS provides authoritative DNS servers and DNS management services.

  1. Login Cloud Console->DNS Settings->Add Record,set Domain Resolution:
  2. The type is A record,host is your sub domain,value is your Internet IP Address.Confirm it
    Host use @ to exactly match the original domain name (for example, yourdomain.tld).
  3. After the Domain Name Resolution please waite for some time until it’s useful(This time is different for different provider of Domain,from 1 minute to 24h)

Note:Please clear the browser cache when Domain Name Resolution is useful but you browser seem is also feedback the old contents of your site

Step1: Binding Domain on WAMPServer

If you use the WAMPServer,please remote to your Server.Open the http-vhosts.conf file,modify the ServerName,ServerAlias to you.then restart all service.

If you have use the Alias,please modify the ServerName and ServerAlias

Routine backup (archives) of the database and application setup is essential to ensure failover is smooth.

Backup is based on the server snapshot automatic backup,manual local backup,using plugin to backup in three ways, three of which have their own advantages and disadvantages, it is recommended to use together

Automatic Backup by Snapshot of Server

IaaS provider have the “snapshot” function for Server, the snapshot is for the server disk. Snapshot tool can record the specified point in time the hard disk data, all backed up, and can achieve a key recovery.

If you have an automatic snapshot of the disk settings, the following scenes you can be more calm face:

  • Work a few days of the results, was mistakenly deleted
  • Hackers damage your site
  • The content has been messed up

Done a snapshot backup, a key to restore to the backup point of time state. That is, on-site reduction, very good function.

Different cloud vendor snapshot settings slightly different, specific reference:

Restore

If you have Snapshot of Server,you can restore all the data by click on button

Refer to:https://stackoverflow.com/questions/31804864/how-to-upgrade-safely-php-version-in-wamp-server

Open the  WAMPServer->PHP->PHP Extension,select the extension you want to enable.If there no extension you need ,you download the dll file to C:\websoft9\wampserver\bin\php\php*\ext folder and “Restart all servivces” to add more extension

How to set the phpMyAdmin allowed only on 127.0.0.1?

This Image have enable the phpMyAdmin remote visit default,if you want to shut down it,please modify the file:C:\websoft9\wampserver\alias\phpmyadmin.conf

find the code section

  <ifDefine APACHE24>
		#Require local
		Require all granted
	</ifDefine>

modify it to

  <ifDefine APACHE24>
		Require local
		#Require all granted
	</ifDefine>

then Restart all the Service of WAMPServer

How to switch the php version?

Open the  WAMPServer->PHP->PHP Version,select the version you want to use,then Restart all the service

This document is original from Websoft9.In order to ensure the seriousness and usability of the documentation, no one may misappropriate or modify the second distribution. The need for friends reproduced please mark the source, otherwise we reserve the right to give legal action.

We will periodically update the documentation. Please visit the online documentation for the latest version

This document URL: http://en.websoft9.com/xdocs/wampserver-image-guide/
Support & Partnership: http://en.websoft9.com