plainblack.com
Username Password
search
Bookmark and Share

Add A Site

As with most things in WebGUI, there's an easy way and a hard way to add a new site for WebGUI. If you used the WRE install, good job, you now have two ways to add a site in under a minute. If you did a source install, good job, that was a lot of work. But the bad news is it's going to take a while to add a site.

Add a Site With the WRE Console

To add a site with the WRE Console follow the following simple steps.

If you don't already have the WRE Console running, you can start it with this command:

data/wre/sbin/wreconsole.pl

Now go to the WRE console with your browser and click on the “Sites” tab if you're not already there.

 

 

 

Now click on the “Add Site” button. This will bring you to a screen that will let you determine some properties for your new site. All that's really important to fill out is the Admin Database Password (you specified this during the initial configuration of the WRE), and the Site Name (like “www.example.com”).

 

Now simply click the “Create Site” button and wait about 20 (may be much slower or faster depending upon the speed of your machine) seconds while your new site is configured. If all goes well you'll see a screen that looks like this.

 

Add a Site With the WRE Command Line

Adding a site from the command line couldn't be simpler. Simply run the following command:

/data/wre/sbin/addsite.pl --sitename=www.example.com --adminPassword=123qwe

 

Be sure to replace “www.example.com” with the sitename you wish to create, and “123qwe” with your actual database administrator password. If all goes well you should see output similar to the following:

www.example.com was created. Don't forget to restart the web servers and Spectre.

 

Add a Site Manually

Adding a site manually is a multi-step process, but if you follow these steps precisely, you'll have a happy working site at the end.

Create a site's web root using the following commands:

mkdir -p /data/domains/www.example.com/public
cp -Rf /data/WebGUI/extras/uploads /data/domains/www.example.com/public/
chown -R nobody /data/domains/www.example.com/public/uploads

 

Be sure to replace “www.example.com” with your site name throughout this process. Also, the chown command uses “nobody” as an example, but it should be whatever user your Apache runs as, which on some servers will be “nobody”, some will use “www”, some will use “httpd”, some will use “apache”, and some will use something else.

Now create the site database using these commands:

mysql -uroot -p123qwe -e “create database www_example_com”

mysql -uroot -p123qwe -e “grant all privileges on www_example_com.* to \

siteuser@localhost identified by 'sitepassword'”

mysql -uroot -p123qwe www_example_com < /data/WebGUI/docs/create.sql

 

Be sure to replace “siteuser” and “sitepassword” with the username and password you'd like the site to use to access the database. Also note that when creating the databases we use underscores “_” rather than dots “.” between the parts of the domain name. That's because dots have a special meaning in the database world.

Now create the site config file by running the following commands:

cd /data/WebGUI/etc

cp WebGUI.conf.original www.example.com.conf

 

Now we need to edit the site config file to match our settings. We've lumped all the changes you need to make into one block here, but you will find these config file directives throughout your config file.

“sitename” : [ “www.example.com” ],

“uploadsPath” : “/data/domains/www.example.com/public/uploads”,

“dsn” : “DBI:mysql:www_example_com”,

“dbuser” : “siteuser”,

“dbpass” : “sitepassword”,

“spectreSubnets” : [ “127.0.0.1/32”, “10.0.0.0/24”, “192.168.0.1/32” ],

 

Be sure to add every IP address, or IP range attached to the machine where Spectre will run (probably this machine) in the spectreSubnets directive.

And finally we need to create the Apache virtual host that this site will be served from. Edit your httpd.conf file and add the following to the end of it:

<VirtualHost *:80>

ServerName www.example.com

ServerAlias example.com

DocumentRoot /data/domains/www.example.com/public

SetHandler perl-script

PerlInitHandler WebGUI

PerlSetVar WebguiConfig www.example.com.conf

</VirtualHost>

 

Of course your virtual host configuration may vary depending upon your system, and what else you have configured in Apache. The above configuration assumes that you have configured the NameVirtualHost directive like this:

NameVirtualHost *:80

 

You should now be able to restart Apache and have a working WebGUI site. And you can use this procedure again if you want to add an additional site.

Keywords: apache mysql new site site webgui site wre

Search | Most Popular | Recent Changes | Wiki Home
© 2018 Plain Black Corporation | All Rights Reserved