Install and Configure ownCloud Server on Windows 7 using Wamp

This article will go through the steps to install and configure everything you will need to setup your own ownCloud Server onto a Windows 7 desktop PC using Wamp.

click here for video tutorial part 1 – wamp and ownCloud

click here for video tutorial part 2 – SSL configuration

Before we start lets go and down load all the files we’ll need to successfully complete this procedure.
We’ll need the following:

  • ownCloud
  • NotePad ++
  • 7zip
  • Wamp – (NOTE: When downloading wamp it may give you a warning that you must have Visual C++ 2010 SP1 and give you a link. Go ahead and click on the link and install Visual C++ if you don’t already have it)

 Wamp Server

Now that we have all the necessary files go ahead and start with the Visual C++ install if needed.
Once that is complete go ahead and install wamp server that you just downloaded.

I would recommend leaving the default install location to “c:\wamp”. Follow the prompts and put in any information that you wish.

1 wamp Install default location

wamp Install default location

At completion it will automatically launch the service if you click finish.
Down the bottom right of the screen you should see  wamp icon pop up and go from Red -> Amber -> Green.
Once it gets to green it means its online and ready.
Now go ahead and open up your browser and in the address bar type in “http://localhost/” and you should see the wampserver home page.

If you see this then apache is ready to go.

1b localhost test in browser

wamp server localhost test in browser

MySql

First we need to setup our MySql database and we start by setting a password for the root user.

Click the wamp icon then phpMyAdmin

wamp -> phpMyAdmin2 mysql phpadmin crop

  • In the phpMyAdmin page click “mysql

2a phpmyadmin

  • In the tab across the top select “Privileges” then look for the line with “User:root” and “Host:localhost” then click “Edit Privileges
2c root privileges

edit root privileges

  • Scroll down until you see “Change Password” enter a secure password then hit “Go”
2d root password

change root password

  • You should see something like the following image once the password is set successfully

2e password set crop

 

 

ownCloud

Extract the ownCloud tar file using 7zip

Extract it into the “www” folder under “c:\wamp” so that the folder path looks like this

c:\wamp\www\owncloud

3 owncloud into wamp

extract owncloud into c:\wamp\www\

Once that’s complete we should now be able to log into ownCloud by typing in the following into the address bar:

http://localhost/owncloud/

  • Create new admin username and password
  • Point to a different location for the data folder if required otherwise leave default
  • MySql settings are as follows
    • User = root
    • Password = the one you create above in phpmyadmin
    • Database name = can be anything you want
    • Localhost = leave default
  • Click finish and it will log you into ownCloud
    (please note the version of ownCloud used in this example is a few years old now so your ownCloud will most likely look slightly different.)
3b MySql Details

owncloud localhost

 

Apache

ownCloud is now running but the problem is that it will only be accessible from the localhost which is not that useful.
Next we’ll go through and configure it so that we can use it on any computer inside your network.

We’ll start by opening Apache config file

Wamp -> Apache -> httpd.conf

4 wamp - apache - httpd crop

 

  • Scroll down until you see “ServerName localhost:80″
  • We want to change this to an IP so that we can get to it from another machine in our local network so change the “localhost” to an IP address specific to your needs
  • ServerName 192.168.1.10:80
4c servername change

servername change localhost to IP

  • Continue to scroll down until you see “DocumentRoot”
  • Towards the bottom of that segment change “Require local”
  • Require all granted
4d documentroot granted

documentroot granted

Save it and then restart apache

Wamp -> Apache -> Service -> Restart

4e restart apache service

Now to test the change. In the browser change localhost with the IP address you just chose

http://192.168.1.10/owncloud

Log back in with your details and test it by using another computer on your local network and log in using the IP.

 

4f owncloud ip login

owncloud ip login

 

Generate a Private Key and Certificate Signing Request

So now that we can access the server from another computer it’s almost useful. Eventually we’ll want to give it access from outside our local network but before we do that it would be prudent to give it some sort of security.

In a command prompt change path to where the file “openssl.exe” is located.

cd c:\wamp\bin\apache\apache2.4.2\bin (remember to change the path to suit your version of apache)

We’ll set the default config file path to avoid errors later with this command

set openssl_conf=c:\wamp\bin\apache\apache2.4.2\conf\openssl.cnf (remember to change the path to suit your version of apache)

Now we’ll need to generate an RSA Private Key and Certificate Signing Request (CSR)

openssl genrsa -des3 -out myserver.key 1024

This command will ask you to enter a pass phrase. Enter a secure password and confirm it.

5 genrsa

set openssl path and genrsa keys

Next, we need to remove the pass phrase from the key to that the server doesn’t pause to request it.

openssl rsa -in myserver.key -out myserver.pem

5 remove pass phrase

remove pass phrase

Now that we’ve created the private key, we need to generate the CSR

openssl req -new -key myserver.key -out myserver.csr

You are about to be asked to enter information that will be incorporated into your certificate request.
There are quite a few fields and you can leave some blank. For some fields there will be a default value.

For this particular field I recommend you put in the local IP that you are using for ownCloud.

Common Name (eg, YOUR name) []:192.168.1.10

5 generate csr

 

Generating a Self-Signed Certificate

To generate a temporary certificate which is good for 365 days, use the following command:

openssl x509 -req -days 365 -in myserver.csr -signkey myserver.key -out myserver.crt

5 self signed certificate

generate self signed certificate

These new keys will be saved under “c:\wamp\bin\apache\apache2.4.2\bin” lets create a common directory for the ssl certificates and move the “myserver.pem” and “myserver.crt” into it.

Create a new folder called “ssl” under “apache2.4.2” directory.

c:\wamp\bin\apache\apache2.4.2\conf\ssl

 

5 move keys to ssl folder

move keys to central ssl folder

 

Configure Apache to Use SSL

wamp -> apache -> apache modules -> ssl_module

5a ssl module enable

ssl module enable

wamp -> php -> php extensions ->php_openssl

5b phpopenssl enable

phpopenssl enable

In explorer locate this file “httpd-ssl” located

c:\wamp\bin\apache\apache2.4.2\conf\extra

We want to change the “virtual_host_default”

Find the following lines and change each to

DocumentRoot “C:/wamp/www/”
ServerName 192.168.1.10:443
Errorlog “C:/wamp/logs/ssl_error.log”
TransferLog “C:/wamp/logs/ssl_access.log”

5c virtual host

virtual host default

Find the lines which says “SSLCertificateFile” and “SSLCertificateKeyFile” and change the path to point to the location where we saved our keys earlier.

SSLCertificateFile “C:/wamp/bin/apache/Apache2.4.2/conf/ssl/myserver.crt”

SSLCertificateKeyFile “C:/wamp/bin/apache/Apache2.4.2/conf/ssl/myserver.pem”

5d ssl certificate file

ssl certificate file and key

 

Find the lines <FilesMatch> and change the line Directory to

“C:/wamp/www/”

Then add the following lines inside those tags:

Options Indexes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

allow from all

5e files match

files match

Scroll right down to the bottom and change the line path for CustomLog 

“CustomLog “C:/wamp/logs/ssl_request.log”

5e custom log

custom log path

 

Restart Apache

wamp -> apache ->service -> restart

Last, but not least, we need to make sure the secure site is part of the virtual hosts in Apache. Open up “httpd.conf”

wamp -> apache -> httpd.conf

Scroll all the way down to the bottom and underneath #Secure (SSL/TLS) connections remove the hash in front of the following line

Include conf/extra/httpd-ssl.conf

Restart Apache

wamp -> apache ->service -> restart

5e enable ssl conf

enable ssl conf

If the wamp icon doesn’t go green then use the following command to check for errors

httpd –t

5i httpd check

check syntax with httpd -t command

Check that port 443 is open by running the following in the command prompt:

netstat -an | more

5f netstat check 443

check port 443 using netstat command

 

Once the wamp icon is green log in using “https”

https://192.168.1.10/owncloud

5g https owncloud

security certificate error due to being self signed

Success!

5h successful login

successfully logged into ownCloud using https

Now that you can log into your ownCloud securely next would be to allow access remotely (from outside your local network). To do that we need to make some changes in our router.

Click here to learn how to configure remote access.

Tags:
  • I am a member of one of the greatist computerclubs of the Netherlands. We hav about 100.000 members.
    I am interrested in the way you make the screen video.
    I am impressed of the quality.
    The reason is, that we in our region will able to make screenvideo’s with instructions en presentations of new hard en software.
    I tried Camstudio, but the result is bad. All blocks and slow en no background.
    So can you help me with information?

  • Hi Henk

    For screen capture try Camtasia Studio is that the one you mentioned?

    http://www.techsmith.com

    Let me know if you have any other issues.

  • Vitalise Psychology

    Hi Loc,
    I went through your guide and set everything up on one computer – it worked perfectly. I then needed to set up owncloud on another computer, followed your guide again. Everything went well up until activating ssl. Once I restarted the apache service it will no longer go green, just stays yellow. I went back through, checked I had done everything right, checked that there were no syntax errors – everything’s good. Do you have any suggestions I could try?
    Thanks Loc,
    Luke

    • Hi Vitalise Psychology. What do the error logs say? under each heading ie apache, php and sql you’ll be able to see the logs. This is a good place to start checking. Most of the time when I see a service can’t start usually because of port conflicts in a config somewhere as it’s easy to miss.

      • Vitalise Psychology

        Apache error log

        [Thu Jan 29 13:25:07.679954 2015] [mpm_winnt:notice] [pid 13672:tid 580] AH00455: Apache/2.4.9 (Win32) PHP/5.5.12 configured — resuming normal operations

        [Thu Jan 29 13:25:07.679954 2015] [mpm_winnt:notice] [pid 13672:tid 580] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:13:13

        [Thu Jan 29 13:25:07.679954 2015] [core:notice] [pid 13672:tid 580] AH00094: Command line: ‘c:\wamp\bin\apache\apache2.4.9\bin\httpd.exe -d C:/wamp/bin/apache/apache2.4.9’

        [Thu Jan 29 13:25:07.680955 2015] [mpm_winnt:notice] [pid 13672:tid 580] AH00418: Parent: Created child process 4112

        [Thu Jan 29 13:25:08.176082 2015] [mpm_winnt:notice] [pid 4112:tid 524] AH00354: Child: Starting 64 worker threads.

        [Thu Jan 29 13:28:39.870030 2015] [access_compat:error] [pid 4112:tid 1004] [client ::1:60703] AH01797: client denied by server configuration: C:/wamp/www/owncloud/data/htaccesstest.txt

        [Thu Jan 29 13:28:40.304366 2015] [access_compat:error] [pid 4112:tid 996] [client ::1:60705] AH01797: client denied by server configuration: C:/wamp/www/owncloud/data/htaccesstest.txt

        [Thu Jan 29 13:29:02.057331 2015] [access_compat:error] [pid 4112:tid 1028] [client ::1:60710] AH01797: client denied by server configuration: C:/wamp/www/owncloud/data/htaccesstest.txt

        [Thu Jan 29 13:33:41.032344 2015] [mpm_winnt:notice] [pid 13672:tid 580] AH00422: Parent: Received shutdown signal — Shutting down the server.

        [Thu Jan 29 13:33:43.033676 2015] [mpm_winnt:notice] [pid 4112:tid 524] AH00364: Child: All worker threads have exited.

        [Thu Jan 29 13:33:43.071700 2015] [mpm_winnt:notice] [pid 13672:tid 580] AH00430: Parent: Child process 4112 exited successfully.

        [Thu Jan 29 13:33:43.554460 2015] [mpm_winnt:notice] [pid 16020:tid 580] AH00455: Apache/2.4.9 (Win32) PHP/5.5.12 configured — resuming normal operations

        [Thu Jan 29 13:33:43.554460 2015] [mpm_winnt:notice] [pid 16020:tid 580] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:13:13

        [Thu Jan 29 13:33:43.554460 2015] [core:notice] [pid 16020:tid 580] AH00094: Command line: ‘c:\wamp\bin\apache\apache2.4.9\bin\httpd.exe -d C:/wamp/bin/apache/apache2.4.9’

        [Thu Jan 29 13:33:43.555460 2015] [mpm_winnt:notice] [pid 16020:tid 580] AH00418: Parent: Created child process 1156

        [Thu Jan 29 13:33:43.951664 2015] [mpm_winnt:notice] [pid 1156:tid 528] AH00354: Child: Starting 64 worker threads.

        [Thu Jan 29 13:41:31.988768 2015] [mpm_winnt:notice] [pid 16020:tid 580] AH00422: Parent: Received shutdown signal — Shutting down the server.

        [Thu Jan 29 13:41:33.991197 2015] [mpm_winnt:notice] [pid 1156:tid 528] AH00364: Child: All worker threads have exited.

        [Thu Jan 29 13:41:34.010208 2015] [mpm_winnt:notice] [pid 16020:tid 580] AH00430: Parent: Child process 1156 exited successfully.

        [Thu Jan 29 13:41:34.835103 2015] [ssl:warn] [pid 2780:tid 508] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]

        [Thu Jan 29 13:41:34.850615 2015] [mpm_winnt:notice] [pid 2780:tid 508] AH00455: Apache/2.4.9 (Win32) OpenSSL/1.0.1g PHP/5.5.12 configured — resuming normal operations

        [Thu Jan 29 13:41:34.850615 2015] [mpm_winnt:notice] [pid 2780:tid 508] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:13:13

        [Thu Jan 29 13:41:34.850615 2015] [core:notice] [pid 2780:tid 508] AH00094: Command line: ‘c:\wamp\bin\apache\apache2.4.9\bin\httpd.exe -d C:/wamp/bin/apache/apache2.4.9’

        [Thu Jan 29 13:41:34.851615 2015] [mpm_winnt:notice] [pid 2780:tid 508] AH00418: Parent: Created child process 8552

        [Thu Jan 29 13:41:35.410152 2015] [ssl:warn] [pid 8552:tid 452] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]

        [Thu Jan 29 13:41:35.427163 2015] [mpm_winnt:notice] [pid 8552:tid 452] AH00354: Child: Starting 64 worker threads.

        [Thu Jan 29 13:47:17.751610 2015] [mpm_winnt:notice] [pid 2780:tid 508] AH00422: Parent: Received shutdown signal — Shutting down the server.

        [Thu Jan 29 13:47:19.752866 2015] [mpm_winnt:notice] [pid 8552:tid 452] AH00364: Child: All worker threads have exited.

        [Thu Jan 29 13:47:19.772879 2015] [mpm_winnt:notice] [pid 2780:tid 508] AH00430: Parent: Child process 8552 exited successfully.

        • [Thu Jan 29 13:28:39.870030 2015] [access_compat:error] [pid 4112:tid
          1004] [client ::1:60703] AH01797: client denied by server configuration:
          C:/wamp/www/owncloud/data/htaccesstest.txt

          This is the only error i can see. would be a good place to start. also do you still have the other setup that is working fine? if you do maybe cross check the configurations?

        • Michal Tomasek
      • Michal Tomasek
    • Michal Tomasek
  • erodz1892

    no matter how many times I try this it just doesn’t work I get hung up on a step per say the Apache icon never went green showed no errors just wasn’t starting. Is there any owncloud alternatives that’s not such a hassle to set up?

  • Durulari Fraga

    Haiii,,,
    I have problem,,,,
    how to install owncloud windows 7,,,

  • nickloos

    Ey, I have some trouble creating a self singed certificate, I get this error:

    c:wampbinapacheapache2.4.9bin>openssl x509 -req -days 365 -in myserver.csr

    -signkey myserver.key -out myserver.crt

    Loading ‘screen’ into random state – done

    Signature ok

    subject=/C=NL/ST=NH/L=Delft/O=henk/CN=192.168.2.10

    Getting Private key

    Enter pass phrase for myserver.key:

    unable to write ‘random state’

    Please help me.

    • @nickloos
      I can’t really see anything glaringly obvious. In the past i’ve had lots of people have issues and it’s always been either some typo or a permissions thing. First as you go through the process make sure that there are absolutely no errors. if there is it won’t work. start with that and see how you go.

    • Michal Tomasek
  • Michal Tomasek

    If you have someone problem:

    “AH00526: Syntax error on line 76 of C: / wamp / bin / apache / apache2. 4.4 / conf / extra / httpd-ssl.conf:

    SSLSessionCache ‘shmcb Session caching not supported (Known names:). Maybe you need to load the Appropriate socache module (mod_socache_shmcb?). ”

    just next line write this:
    LoadModule socache_shmcb_module modules/mod_socache_shmcb.so