Skip to content

Server Set Up

evanmena edited this page Nov 29, 2017 · 14 revisions

Server Set Up (Apache)

The PHP server should be run from the public/ directory. This is where the .htaccess file and the index.php file are stored. When using an Apache server, this would be the DocumentRoot.

Location of the code

The code is normally placed in the htdocs/ folder of the Apache server instance.

Note: It really doesn't matter the location of the code, as long as the DocumentRoot is pointing to the code location.

Update the DocumentRoot

To change the DocumentRoot to use the public/ folder, locate the httpd.conf file, which is usually located in the conf/ folder within the Apache server. Change the commented lines below to represent the path to the code's /public folder.

# httpd.conf
 
...
 
DocumentRoot "path/to/base/directory/public"            # change this
<Directory "path/to/base/directory/public">             # change this
    ...
</Directory>
 
 
...
 
 
<VirtualHost 127.0.0.1>
    DocumentRoot "path/to/base/directory/public"        # change this
    ServerName 127.0.0.1
    <Directory "path/to/base/directory/public">         # change this
        Options FollowSymLinks Indexes ExecCGI
        AllowOverride All
        Order deny,allow
        Allow from 127.0.0.1
        Deny from all
        Require all granted
     </Directory>
</VirtualHost>

Note: the <VirtualHost> is not always present in all Apache httpd configurations

Add PostgreSQL Dependencies

Edit the php.ini file to include the postgres DLLs

 
...
 
extension=php_ldap.dll          ;uncomment this line
 
...
 
;extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll     ;uncomment this line
;extension=php_pdo_sqlite.dll
extension=php_pgsql.dll         ;uncomment this line
;extension=php_shmop.dll
 
...

Then you need to copy PHP's libpq.dll and libsasl.dll into Apache's bin/ directory.

Add Database User Password

v0.1.x

The configuration for the database is found in the core/database/db_config.ini file. This file will not be here when you pull from develop. Please create this file. It is ignored by the .gitignore so everyone doesn't commit their own settings. Just change the password and settings to connect to the database of your choosing.

The file looks like this:

; This configuration file is used to configure the settings
; for the database connection

[connection_settings]
host = 10.11.12.33
port = 5432
user = postgres
pass = [Actual Password]
dbname = PEP_DB

v0.2 and higher

The configuration file is located in the base directory and named config.ini. The db_config.ini file no longer exists. Just like above, you need to create this file since it is in the .gitignore.

; This configuration file is used to configure the settings
; for the system

[database]
host = 10.11.12.34 
port = 5432
user = postgres
pass = [Actual Password]
dbname = PEP_DB

[ldap]
host = 10.11.12.27
port = 389
user_domain = @thecpca.com

[survey]
database = Actual
username = postgres
password = [Actual Password]
address = 10.11.12.24
googleEmail = [Actual Email]
googlePassword = [Actual Password]