|
Linux Troubleshooting
If you are having trouble with a linux install hopefully you will find a solution to your problem below. If none of the points below help please contact us via our Feedback page.
You should be aware of the following points when checking or setting file permissions for QaTraq
- the owner of the qatraq files should make sure that the files have permissions set so that they can be read by others.
- the attachments directory should be readable/writable for everyone. The attachments directory should NOT have execute permissions for everyone.
- when owner of the qatraq files is the apache process the files should be readable only for their owner. In this case the attachments directory should have read/write permission for its owner.
When it comes to getting the permissions right for the ./attachments directory the following should help:
First of all it's important to have webserver configured well. Type:
ps aux
and look who is the owner of the apache process. Default owner should be "apache". If so it means that you have user "apache" and group "apache" on your system. To be sure:
cat /etc/passwd | grep apache
cat /etc/group | grep apache
If above commands return results it means that everything is good. Now let us take a look at the document root directory. On a typical system it could be: /var/www/localhost/htdocs/
It could be different on other systems though.
Let's go to the qatraq directory. There are many files and directories. First should we change the owner and group of those files (default is: owner: root, group: root):
chown apache *
chgrp apache *
Now all files and directories belong to the apache user and group (the same has to be done for subdirectories). Now:
chmod 400 *
All files have read permissions only for their owner (which is apache). All directories should have:
500 rights. So:
chmod 500 lib
chmod 500 DB
etc.
etc.
All directories must have those rights set correctly. The most important directory is the attachements. It must have other rights set. This means:
chmod 700 attachements
Now, you should enter every directory and begin procedure from the beginning - so:
cd lib
chown apache *
chgrp apache *
chmod 400 *
chmod 500 for_directories
The php.ini file is also critical for attachments. There are many options and many of them can influence on Qatraq. Critical for uploading is directive:
file_uploads =
which must be turned On. Without this set to On PHP won't let anything be uploaded. file_uploads is usually turned on by the default so this shouldn't be anything to worry .
upload_tmp_dir =
This line is commented out by default so to use this directive it should be uncommented (removing ";" from the beginning of the line). It's a rather less important directive. It is used to store temporary uploads. When nothing is entered for this directive PHP will use standard system tmp directory which is "/tmp". This can be changed to something like /usr/upload_tmp if need be. Don't forget that it should have the right permissions though : 700 and owner must be "apache" and group must be: "apache" or 777 and owner and group are not important in this case.
upload_max_filesize =
This directive is important for the server administrators who can prevent uploading very big files. Value for that directive depends on needs of user. If you want to upload 10 M files this directive should be set, for example,. to 12 M (to ensure that 10,5 or 11 M file also will be uploaded).
Other important php.ini directives:
safe_mode =
If safe_mode is on, there will be some security features enabled. Some functions will be disabled etc. It should not influence Qatraq. However when permissions are not set up correctly, safe_mode can generate errors.
disable_functions =
this should be left blank unless you know what you are doing. for example adding the fopen function here prevents Php from reading any files. Adding mysql_connect means QaTraq will not be able to connect to the database.
There are also many other directives in php.ini file. They are described very well in the documentation for PHP.
Following a clean install of QaTraq the user_name/password combinations shown below should log you into QaTraq. :
test1 / test1
or
admin / admin
Sometimes however, you may have problems logging in following an install. Sometimes this is because of something we've done wrong and sometimes its because of something you've done wrong. You may find that one or more of the steps below will help you out with login problems. If they don't please don't hesitate to contact us for more help.
First, make sure you have the QaTraq config file (db_params.php) set up properly. See the 'Modify the db_params.php' section in the following install instructions:
Second, make sure the two Mysql user accounts required by QaTraq have been set up correctly. Again, see the 'Create the QaTraq database' section in the install instructions:
If both of the above are correct then we have to dig a bit deeper....
Third, try enabling logging and then taking a look at the log files.
Edit the file lib/db_qatraq.php changing the following line to enable logging
$GLOBALS['LOG_ON_QUERY'] = 1;
Running under linux you will find the log files here...
/tmp/tmt<date>.log
/tmp/tmt_err<date>.log
If you don't find the log there you'll need to change the place where the log files are created in the file lib/log.inc....
define ('TMT_LOG_FILE', '/tmp/tmt'.date("Ymd").'.log'); // log file
define ('TMT_ERR_FILE', '/tmp/tmt_err'.date("Ymd").'.log'); // error file
If the logging step doesn't point you in the right direction then.....
Fourth, take a look at the users table with 'Select * from users'. You should see a table with values like this....
1 test1 test1 <xxx encrypted password xxx>
2 admin admin <xxx encrypted password xxx>
3 dummy dummy <xxx encrypted password xxx>
Finally, dropping the database and creating the database again with (we're assuming you've not entered any data here....as you'll loose everything when you drop the database)....
mysql -u root -p<password> -e "drop database qatraq"
mysql -u root -p<password> -e "create database qatraq"
cd qatraq/DB
mysql -u root -p<password> qatraq < qatraq.sql
If you still can't login after going through these steps then please get in touch. Send us the relevant lines from the log files and the users table. Then we'll see if we can get you sorted out. If you can provide us with the following information too then this would help:
Version of QaTraq: eg qatraq_5_1_rc
OS: eg windows Xp
From lib/db_qatraq.php the following:
$db_data['tmt'] = array(
'host' => 'localhost',
'db' => 'qatraq',
'user' => 'qatraq',
'password' => 'xxxx'
);
For QaTraq to run the following three directives are required:
MySQL Support = enabled
Session Support = enabled
GD Support = enabled
However, it would seem that in some installations of PHP5 the ‘--enable-session’ directive is not enabled. This directive is critical for running the QaTraq. Enabling the session directive (if it is not already enabled) requires are re-compile of the Php5 source (see below for a link which provides information on compiling Php from source)
Getting PHP4 and MySQL5 to work together is not simple. It's extremely important that libmysql provided with PHP4 does not handle MySQL5 connections! If you are running with Php4 we suggest you stick to MySql4. However, if you are brave:
The bundled version of libmysql library with Php4 does not handle authentication of new MySQL5, so you can not connect to the database. PHP5 is not bundled with a version of libmysql so there is no problem - PHP5 searches for this library automatically and it uses what it finds. However there is a need to specify exact path to libmysql library in PHP4:
./configure --with-mysql=PATH_TO_MYSQL_DIRECTORY
And here is the next big problem. When you make a default installation of MySQL, program files are divided into some separate folders. It makes it difficult to specify one path to MySQL because libraries, include files, binary files are in different locations. It is especially dangerous for users who run installation commands for specific Linux distributions such as Debian or Gentoo. Using standard Gentoo command:
emerge mysql
will install MySQL on the computer. However files will be stored is many different locations - PHP4 will not recognize all paths (PHP5 will) and will build bundle version of library. Solution is simple: MySQL need to be compiled manually from the sources and --prefix must be specified while configuration process. So configuration of the MySQL should include:
./configure --prefix=SOME_PATH
and then this path must be given to PHP4 - so while configuring PHP4 following option must be
included:./configure --with-mysql=SOME_PATH
This should work. However, this is likely to cause problems for inexperienced Linux users. While running "emerge mysql" everything is handled by the operating system. When compiling this manually user must take care of adding mysqld to startup, handling problems with usernames (mysqld should not be running as root user).
Don't say we didn't warn you :-)
QaTraq does have a logging process, which can help identify issues. Linux log files for QaTraq can be found here…
/tmp/tmt<date>.log \
/tmp/tmt_err<date>.log
Logging can be turned off or on by editing
lib/db_qatraq.php
Logging can be configured by editing this file
lib/log.inc
If you really are starting from scratch, downloading Apache, Php and MySQL, then you may find the following article helpful:
Often the cause of page display errors can be down to simple file permission and ownership issues. Where there are strict file permissions the apache process can not access the files that need to be displayed.
For example user apache (group apache) can't read files owned by root unless they have read permissions for others (i.e. "chmod o+r info.php"). Alternatively run chown + chgrp to make the info.php file owned by a more appropriate user.
|