What do I enter for Host Directory in Dreamweaver?

Question:

I’m setting up Dreamweaver and am stumped on what to enter for Host Directory. Can you help?

Answer:

The host directory is the directory on your hosting account which contains your websites files (also known as the document root or docroot). By default this is “www”. If you have set up multiple domains, set Host Directory to whatever directory you used when you set the domain up. If you are not sure, check the “Domains” sections of your control panel and it will show you all your configured domain name mappings.

To conclude, use these values to configure Dreamweaver:

Host: your-domain.com (if testing a domain not transferred to us use: your_username.phpwebhosting.com)
Host Directory: www (usually – unless you’ve mapped the domain to someplace else)
Login: your username
password: your password

How do I install drupal on my hosting account

Drupal installs easily on phpwebhosting.com servers. ssh to your server and type the following:

1. Download drupal

wget http://ftp.osuosl.org/pub/drupal/files/projects/drupal-4.7.2.tar.gz

(get the latest download address from the drupal website)

2. unpack it and cd to the drupal directory

tar xzpvf drupal-4.7.2.tar.gz

3. make drupal your default web dir

mv www www_old
mv drupal-4.7.2 www

(you can also keep your existing www directory and move drupal to a subdir of www)

4. Edit the config file

emacs sites/default/settings.php

search for :

$db_url = ‘mysql://your_username_here:your_password_here@localhost/your_database_name’;

(line 87 in the current settings.php – might change in the future)

Be sure to replace :

your_username_here
your_password_here
your_database_name

with your actual username, password and database. When you signup a database with your username is created automatically. You can use that one or create a new one.

5. Create the database

mysql -u your_username -p your_database_name < database/database.4.1.mysql 6. Load your site Go to your site and create a user. The first user created will become the admin user with all rights. 7. Your are done - enjoy!

TikiWiki install problem (500 error)

Question:

I’m currently trying to upgrade the web application “TikiWiki” on my site to the latest, stable version but cannot access the install page: “my_username_here.phpwebhosting.com/tikiwiki-1.9.2/tiki-install.php”.

Every attemt returns “Internal Server Error 500.”

Any idea what is going on?

Answer:

TikiWiki installs sometimes hit against our default mod_security (http://www.modsecurity.org/) rules.

This page:

http://support.phpwebhosting.com/security/how-can-i-turn-off-mod_security-for-my-site

show you how to turn mod_security off on your site. Quick version: add the line :

SecFilterInheritance Off

to a .htaccess file in the directory of your install.

I would suggest your turn it off for the install and then back on afterward. I think TikiWiki may just be tripping on the install code.
Most likely you can turn mod_security back on after the install is complete. In general mod_security causes few if any problems but does a good job of protecting your site against any new exploits that may affect the scripts you run.

Also, you can view the live error and audit (mod_security) log at:

/usr/local/apache/logs/error_log

and

/usr/local/apache/logs/audit_log

Let us know if you continue to have problems.

Can you make mysql index 3 letter words? (adjust the ft_min_word_len value)

Question:

I want my mysql full-text indexes to index 3 letter words. The default is 4 letters. Can you fix this?

Answer:

Sure, no problem.

Many of our servers already have this set. If yours does not just send in a support ticket and we’ll update it for you. After the update, you’ll need to rebuild the existing indexes to index the 3 letter words. Any new indexes will use 3 letters by default. The documentation at mysql.com has instructions for updating your indexes.

How can I set php’s include_path

Question:

How can I set php’s include_path?

Answer:

Quck fix for any version

With any version of php you can add this to the top of your script:

ini_set ( “include_path”,”.:/home/your_username/www/:/home/your_username/www/dir/subdir/” );

This is a good fix if for some reason you cannot get other methods to work.

In general though, you should use one of the next two methods:

When using cgi-based php
If you are using one of the cgi-versions of php, you can set this by editing

/home/your_username/etc/php.ini

If this is your first time editing php.ini you may need to create the etc/ dir and upload a default php.ini

When using mod_php php

If you are using the mod_php version, you can set this in a .htaccess file with :

php_value include_path ".:/home/your_username/www/:/home/your_username/www/dir/subdir/"

Still having problems?

If you get a 500 error, then there is a syntax error in your .htaccess file.

If the pages loads but you do not get the intended result, make a page with just:


< ? phpinfo(); ?>

in it. When you load this page it will show you all the php vars for the page. Make sure the path is set how you wanted it. If it is but your scripts still do not work you’ll need to adjust them or your scripts until you get what you want. It can be hard to get the right path since your scripts may be operating differently from what you expect.

Keep in mind:

Your base dir on the filesystem is always:

/home/your_username/

Your web base dir is (unless you’ve customized your base dir):

/home/your_username/www/

Google sitemap verification error (404 versus 200)

Question:

I have submitted my sitemap to google. During the verifiction process, google reports an error from their verification saying that the server is reporting a status 200 instead of an error 404.

Could you assist with this?

Answer:

This occurs when you are running php as a cgi and a non-existant php page is called. When php runs as a cgi the webserver never checks for valid files – it just sends it straight to the php parser. The php parse does not return a 404, instead it errors with “No input file specified”

Add the following to your .htaccess (or create a .htaccess file if you don’t already have one) and it should fix it

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^.+.php$ /file_that_does_not_exist

The code above will cause the server to check for valid files first and redirect to a file that does not exist and trigger the 404.

Forcing all requests from one domain name to go to another (and update address bar)

This is a mod_rewrite recipe that will force all requests for your hosting account to be
redirected to a particular domain.

Here’s an example:

You have

my-domain.com,
my-domain.net,
my-domain.org

on your account. You would like requests for any of the domain names to go to:

my-domain.com

and to update the address bar in the browser to reflect this.

Here’s how to do it :

Create a .htaccess file in your top web directory (the directory www for most users)

put the following lines in it:


RewriteEngine On

# this will force all domain requests to go to my-domain.com
RewriteCond %{HTTP_HOST} !^www.my-domain.com
rewriterule (.*) http://www.my-domain.com/$1 [R=permanent,L]

How Do I determine the full path to a directory?

Question:

I have a script that is asking for the full path to a file. How do I determine this?

Answer:

Hi,

The full path would be:

/home/your_username/

plus the rest of the path in your ftp.

For example if it was in your

data

dir it would be :

/home/your_username/data/

if it was in :

some_dir1/sub_dir2/data

it would be :

/home/your_username/some_dir1/sub_dir2/data

Be sure to replace :

your_username

with your actual username

Also, keep in mind that all server paths are case-sensitive. Use all lowercase unless one of your directories has capital letters in it.

Why do I get blank form submissions?

Question:

Starting last week we have been receiving e-mails (maybe 5-10 a day) that the subject is “Form Submission”. However the email is blank. There is no From or other information in the email.

Where are these e-mails coming from? Are these generated from our website or somewhere else? Any guidance you can provide would be helpful.

Answer:

Hi,

I checked your site and it looks like you are using the popular formmail.pl script.

Usually these type of emails are generated by badly wrote web-robots (search engine indexers, etc.) that are indexing your site and submitting the blank forms.

Another likely possiblilty is that they are spam-bot attempts to use your form to send out spam. I checked out your script and it is the latest version so you should be safe. Older versions of formmail.pl had a bug that allowed spam sending so there are all kinds of spam-bots out searching for exploitable formmail.pl scripts to exploit.

Again if you are using version 1.92 or above you should be safe. If you are using anything older, you need to upgrade ASAP!