Some frequently asked questions about our Linux shared web server.
How do I view the Powernet-README.txt file?
By default: http://your.site.name/Powernet-README.txt
Alternatively, log in using SSH, then type
less /usr/local/Powernet-README.txt
Many of the following questions are either answered in the Powernet-README.txt file, or explained in more detail there.
Why do my PHP pages say "Internal server error"?
The first five characters (i.e. the very first thing on the very first line) of each PHP file must be: <?php
Each PHP file must be made executable
See the README file for more information.
How do I make a file "executable"?
Either: log in using ssh, then use "chmod +x FILE" :
cd html chmod +x index.php # Short cut: do all "php" files in this directory chmod +x *.php
Or: if you upload your web site using FTP, your FTP program may include an option for marking files as executable. Look for a setting for "Change permissions", or similar.
If your FTP program allows you to manually enter FTP commands, use the command SITE CHMOD 755 foo.php to mark the foo.php file as executable
Why do some of the characters on my web page display as question marks?
All text files, including web pages, use a character encoding (or character set). If the web server's encoding doesn't match your page's encoding, you might see non-ASCII characters (such as pound signs, the copyright symbol, accented letters, or "smart quotes") displayed incorrectly.
The web server's default character set is UTF-8. If your web pages are not encoded using UTF-8, some characters may display incorrectly.
There several possible ways to fix this:
- Rewrite your pages in UTF-8 encoding. Depending on how you create your web pages, this may be as simple as finding the right setting in your web design program and re-saving the pages.
Or, rewrite your pages to use HTML entities (e.g. £) for all the non-ASCII characters. You may find the w3schools web site useful for this.
- Or, override the server's default charset of UTF-8:
To do this, create a file called .htaccess in your html directory; the file should contain just the following line:
AddDefaultCharset Off
- If you're uploading your web via FTP from a Windows PC, you might have trouble creating a file called ".htaccess". You might find it easier to create it as something like "htaccess.txt", then upload it, then rename it to ".htaccess" using your FTP program.
See the README file for more information.
How do I make a password protected area?
To do this, you need to do two things:
- Create a password file, containing the usernames and encrypted passwords of those people who are to be allowed access
Tell the web server that, before allowing access to <whatever directory you want to protect>, that people must log in using that password file
Creating the password file
Log in to the server (using SSH), and create yourself a password file:
cd ~/data htpasswd -c mypasswords myusername
This creates a password file called "mypasswords", and adds a user called "myusername" into that file. If you've already got a password file, you can add more users by leaving out the "-c":
htpasswd mypasswords anotheruser
Making the web server use that password file
Now you've got a password file, you need to tell the web server that if anyone wants to access the directory you want to protect, they must authenticate using that password file first.
To do this, create a file called .htaccess in the directory you want to protect, and add the following:
AuthType Basic AuthName "Protected Area" AuthUserFile /custdata/<YOUR WEBSITE NAME HERE>/mypasswords Require valid-user Satisfy all
Change <YOUR WEBSITE NAME HERE> to the name of your website. If you're not sure what name to use, log in using SSH then type
readlink ~/data
How do I send email from my web site?
Log in (using SSH) and read /usr/local/bin/shared-cgi/formmail-README.txt
See also the README file.
How can I redirect my page to another site?
Log in and create a file called index.cgi with the following contents:
#!/bin/sh echo "status:302 moved temporarily Location: http://<NEW WEBSITE NAME HERE> "
Then make the file executable.
When I send email from my web site, why isn't it getting through?
One possible reason is that it's being sent using an invalid sender address.
All email needs to have a valid sender address (a.k.a. bounce address, return-path, "MAIL FROM" address). Mail which is sent using an invalid sender address will most likely not get delivered.
When you send mail from your web hosting account, it always uses the same sender address. At Powernet we sometimes refer to this as the "webmaster" address, simply because people often choose to use an address like <webmaster@example.com>. However it doesn't have to actually be "webmaster@" anything - it can be any address you choose, as long as it's valid.
If this address is set up incorrectly, you probably won't be able to send any mail from your web.
To fix this, make sure that the sender address used by your account is valid.
To see what address is being used for your account, log in to the server using SSH. When you log in you'll be shown some "welcome" messages, including the current setting of your sender address.
To change the sender address, get in touch and let us know what sender address you'd like to use instead.