(Answer) (Category) WebGUI FAQ : (Category) Installation :
Installing WebGUI on FreeBSD 5.4
Installing WebGUI 6.7.3 on FreeBSD RELEASE-5.4
The following is based on a minimal install of FreeBSD via the sysinstall program on the FreeBSD CD, assuming FreeBSD 5.4. It is assuming that you are performing all actions as the root user. It is also assumed that you are using Apache 2 and ModPerl 2.
Directions:
1. Install a minimal FreeBSD system.
2. Do a remote install of the packages below via ‘pkg_add –r + <packagename>’. Then log out of your system and log back in. For some reason newly installed programs that are in your PATH environment variable are not picked up until you log out and back in again.
    a. wget (or another tool you like to download WebGUI)
b. mysql41-server
c. mysql41-client
d. ImageMagick
e. transfig
f. apache2
g. perl
h. pine (optional, I don’t like the way vi works on FreeBSD so I like to use pico)

3. Prep your mysql database
    a. Run "/usr/local/sbin/mysql_install_db"
i. The binary installation does not create the system databases for you. It gives you a config to dump the database under /var/db/mysql.
b. Run "chown –R mysql /var/db/mysql"
i. This sets the correct permissions on all the files that mysql_install_db just crated. This allows the mysql user to actually access the database that you as root just installed.
c. Try to run the mysql server and see if it works.
i. Run "/usr/local/bin/mysqld_safe &"
ii. Run "mysql"
1. If you see a mysql prompt, you’re set.
    a. You really should set a password at this point for the root user on 
       mysql. You can do this at the mysql prompt by issuing the command ‘set 
       password = password("<newpassword>");’ Ignore the single quotes and 
       replace <newpassword> with the password of your choice.
2. If you don’t, something isn’t right.
 
4. Download the latest WebGUI source installation of your choice. This document
    is based on 6.7.3, keep that in mind.
a. Extract the file…
i. gzip –d <thefileyoudownloaded>
ii. tar –xf <thefileyoudownloaded>
b. Now if you look inside WebGUI/sbin/ you will find the testEnvironment.pl perl script. If you open it you will find all of the non-WebGUI Perl modules that are required.
c. As of 6.7.3, the following list shows the required modules.
If an arrow appears beside them, then that is the equivalent package that needs to be installed either by the sysinstall utility or the pkg_add –r <packagename> command. Some of the listed packages might be dependent on another one on the list. I’m not going to worry about my list being redundant, better redundant than missing a package and not knowing what happened.
Modules that do not show a FreeBSD package name beside them are taken care of from CPAN. The instructions for those follow this step.
i. LWP -->p5-libwww
ii. HTTP::Request -->p5-libwww
iii. HTTP::Headers
iv. Digest::MD5 -->p5-Digest-MD5
v. DBI -->p5-DBI
vi. DBD::mysql -->p5-DBD-mysql41 (assuming you use server 4.1)
vii. HTML::Parser -->p5-HTML-Parser
viii. Archive::Tar -->p5-Archive-Tar
ix. IO::Zlib -->p5-IO-Zlib
x. Compress::Zlib -->p5-Compress-Zlib
xi. Net::SMTP -->p5-Net-SMTP-Server
xii. Tie::IxHash -->p5-Tie-IxHash
xiii. Tie::CPHash
xiv. XML::Simple -->p5-XML-Simple
xv. SOAP::Lite -->p5-SOAP-Lite
xvi. Time::HiRes -->p5-Time-HiRes
xvii. Log::Log4perl -->p5-Log-Log4perl
xviii. Net::LDAP -->p5-ResourcePool-Resource-Net-LDAP
xix. Date::Manip -->p5-Date-Manip
xx. HTML::Highlight
xxi. HTML::TagFilter
xxii. HTML::Template -->p5-HTML-Template
xxiii. Parse::PlainConfig
xxiv. XML::RSSLite
xxv. DBIx::FullTextSearch 1. If you installed mysql41-server from the binary and already set up your system tables as described above, then this dependency will be met. It may rely on some of the packages listed above as well, but either way, after installing your server properly this test will pass.
d. After you install all of the above modules you will need to do the following…
i. IMPORTANT --- Please not that at any time if you are asked if you want to install a prerequisite module, do it. Otherwise you will run into problems because the modules won’t install.
ii. Run "perl –MCPAN –e shell" 1. If this is your first time running the shell read the following, otherwise move on to ii.
a. Accept the defaults, the only one I changed is the line where they make the suggestion that some people add "UNINST=1". I followed that recommendation as it is supposed to remove conflicting files. Continue on with the defaults and you should be fine until it gets you to the prompt. Now you’re ready for step ii.
iii. You now need to install some modules at this shell. Assuming all is going well, you can just install them without problem by running the command, "install <ModuleName>" without the quotes and replacing ‘<ModuleName>’ with the perl module’s name. Install the following modules by this method using the following names…
1. Tie::CPHash
2. HTML::Highlight
3. HTML::TagFilter
4. Parse::PlainConfig
5. XML::RSSLite
iv. Exit the shell by typing, "exit." (no period after exit)

e. Special Cases
i. ModPerl v. 2 1. I tried using the mod-perl2 package that FreeBSD supplies as a binary, but it didn’t work, even after changing some of the referenced names in WebGUI’s preload.perl script. I instead installed this from source. This is why I did not list it above as one of the FreeBSD packages to install.
2. It needs to be noted that if you want to run the tests on your mod_perl to ensure that it everything works correctly, you need to compile it as a non-root user to run the tests. If you are daring and want to quickly install it follow instructions under ‘b’ below, otherwise follow the instructions under ‘a.’
a. You can easily get the source by going into a cpan shell as described above by running, "perl –MCPAN –e shell" and at that shell type, "get mod-perl2" to retrieve the source. Exit the shell.
i. cd to /root/.cpan/build/ directory.
ii. Issue an ‘ls’ to find the source directory for ModPerl.
iii. cd to that directory.
iv. Run "perl Makefile.pl MP_APXS=/usr/local/sbin/apxs" 1. The path in the command above is where FreeBSD’s binary install of Apache 2 puts this file. It might be different for you if you didn’t use the binary install, quite possibly at /usr/local/apache2/bin/apxs.
v. Run "make"
vi. Run "make test"
vii. If all tests pass run "make install"
viii. Exit the shell.
b. Enter a cpan shell by "perl –MCPAN –e shell"
i. Run "install mod_perl2"
ii. When it asks you if you want to skip the tests, type yes. It will prompt twice.
iii. Exit the shell after you have finished.
ii. Image::Magick (aka PerlMagick)
1. The binary install of ImageMagick from FreeBSD is fine, however it seems to be a source of grief. Every time I start apache, it bombs out with a core dump when Image::Magick is preloaded. The Image::Magick module is installed as part of the binary installation of the ImageMagick package from FreeBSD. Using their package, Apache core dumps and dies completely. I kept my binary install, but went ahead and did a manual install of the Image::Magick module from CPAN. The instructions follow…
a. Enter a cpan shell (see 4.e.i.2.b. for instructions).
b. Run "get Image::Magick"
c. Go to the cpan build directory (see 4.e.i.2.a.i.)
d. Run "perl Makefile.pl"
e. Run "make"
f. Run "make test"
g. For me it seems to fail on one of the X tests, but considering I’m not worried about this functionality, I’m ignoring it and am going to install it anyway.
h. Run "make install"
i. You’re done with the install of ImageMagick.
j. For reference, it is interesting to note that I have been able to compile every piece of software for WebGUI on FreeBSD and install it and the only thing that causes Apache not to work is the Image::Magick perl module. If I remove all references to Image::Magick in WebGUI, the server starts fine, although you miss out on the images in WebGUI.
iii. Bundle::Apache2
1. Perhaps some of these packages are in the FreeBSD packages distribution, but I didn’t know which ones they would be and I needed to be sure that I had the ones for Apache 2.
2. Install these using the cpan shell. I didn’t have any problems with them so a standard, "install Bundle::Apache2" should work.
f. You should now have the basic requirements installed for WebGUI.
i. Enter the WebGUI folder you extracted earlier and go to the sbin subdirectory.
ii. Run "perl testEnvironment.pl" If everything passes and it doesn’t ask you to install anything more, great. You’re ready to move on. Else, review the instructions above and check where things went wrong.

5. Assuming you made it through section 2 without a hitch, you are now ready
   to follow Plain Black’s instructions to continue your install. Using WebGUI 
   6.7.3 you should not have to worry about the perl modules that they tell 
   you to install at the beginning. They will already have been installed by 
   these instructions, either explicitly or they were installed as a 
   dependency of another module. At the time of this writing, the instructions 
   were located at http://www.plainblack.com/installing_webgui . I’m not going 
   to include those instructions here because they are part of the WebGUI site 
   and I don’t want to steal the instructions from there to include them here.

6. Put the name of your server in your /etc/hosts file. This is especially
   important to Apache if you are using an internal machine with a dummy name. 
   Apache will die if you don’t have it’s name in the host file.

7. When you finish with Plain Black’s instructions, you may notice that you
   start your server with a core dump. Hopefully if nothing changes, Apache 
   will still be running and this won’t be anything more than a minor 
   irritation. However, if you installed Apache with the FreeBSD binary, you 
   need to check your httpd.conf file under /usr/local/etc/apache2/httpd.conf. 
   You need to do this because you will notice that you cannot view your 
   WebGUI site because of security restrictions.
a. If this is your production system, ignore the following. You need to know Apache and how to use its security system. DO NOT follow the instructions below because it is a security risk and I’m not responsible for stupid actions that other people do on their own servers. You have been warned.

    b. Re-read ‘a.’ above, then you may read ‘c.’ below.
c. For a simple system that you want to do some testing and playing around with WebGUI on, you can find the main section for the <Directory /> directive for Apache. You need to specifically find the one that opens with "<Directory />" and closes with "</Directory>" because it’s an easy way to quickly remove the security and be able to use your WebGUI installation.
d. Change the line that says "Order Deny,Allow" to "Order Allow,Deny"
e. Change the line after that that says "Deny from all" to "Allow from all"
f. Remember that section ‘a.’ is important. This is not a safe way to setup your web server.
g. You can now restart apache.

8. Assuming all went well, you will want to enable Apache and MySQL on
   startup. You will need to edit /etc/rc.conf to do this. At the end of the 
   file append one line for each server, for Apache, enter
   ‘ "apache2_enable="YES" ‘ to enable it on startup. For MySQL, enter 
   ‘ mysql_enable="YES" ‘ to enable it. Ignore the single-quotes, but the 
   double quotes are needed.

You should be finished!
Hope this helps some other strugling newby to FreeBSD and WebGUI.
Troy

troyDOTcaldwellATcovchurchDOTorg
you can use the rehash command instead of having to log out and log back in.
wg-fomATgwyDOTorg
In deference to the above regarding security restrictions, I would suggest that you keep the secure defaults of deny, allow, and merely allow,deny the directories you use, including extras and DocumentRoot...
 Alias /extras /path/to/extras
 <Directory /path/to/extras>
    Options ExecCGI FollowSymLinks
    AllowOverride None
    Order Allow,Deny
    Allow from all
 </Directory>

wg-fomATgwyDOTorg
[Append to This Answer]
Previous: (Answer) I know absolutely nothing about configuration of Apache, MySQL, or WebGUI. Is this easy to install?
Next: (Answer) "WebGUI 7.0.6"+"Dapper Drake"
This document is: http://www.gwy2.org/cgi-bin/fom?file=86
[Search] [Appearance]
This is a Faq-O-Matic 2.721.
This FAQ administered by ... Gerald Young