Html Page Upload to Server in Index.html Vs Cgi
Students and staff in the School of Computer science & Information science, can upload and publish their own websites on the School's users
Web server. The information here volition tell you how to create the website, how to upload or remove pages, and how to write and install CGI programs. It also tells you how to publish your site so that it can exist viewed on the Www.
Staff and students in Cardiff School of Computer science & Informatics can create and publish a website on the School'southward users
spider web server https://users.cs.cf.ac.united kingdom of great britain and northern ireland/. Use of the users website is purely voluntary — it is non necessary for your work within the School. Yous make up one's mind whether or not to create pages for the server and whether or not to publish
them on the Earth Wide Web. Web projects and other work for your course modules in the Schoolhouse should be installed on the the School's projection
spider web server (see Creating a Spider web site on the School's Project Web Server).
Setting up a Spider web Site
There are a few steps for setting up a website.
- Upload files to your site through the Schoolhouse'due south website upload file server websites.cs.cf.air conditioning.u.k..
- Visit https://users.cs.cf.ac.united kingdom/ and
publish
your website. - Browse to https://users.cs.cf.air-conditioning.uk/MailName (where
MailName
is your mail name) to see your website.
Uploading your Pages
In social club to create your users website, y'all volition beginning need to upload files to it - HTML files, PHP script files or CGI scripts.
You can upload pages through the School'southward website upload server websites.cs.cf.ac.united kingdom of great britain and northern ireland.
For further details on uploading files please refer to:
- Accessing Your University Files from Windows
- Accessing Your University Files from Linux PCs and Laptops
- Accessing Your University Files from a Macintosh
Publishing your Web Site
Even after upload, your website is not available for viewing until you publish
it. Publishing your site volition list information technology in the users website alphabetize folio and make its URL available to the Cyberspace.
Open up the URL , and you will see the alphabetize page where all of the users websites are listed.
In the left-side menu, notice the entry Publish your site
. Click on this to begin the process of making your site visible.
Y'all volition demand to authenticate to become to the Publish Your Site
folio. On the folio, enter your countersign again and click the Authorise
push. This will publish your pages on the users
site.
When y'all click on the Authorise
push button, you lot agree to abide past the rules that apply to the users
server. Your postal service name will appear on the users
index page and your website will be attainable over the World Wide Spider web. Information technology is your responsibility
to ensure that the pages you publish are proper and lawful
.
After a few minutes, your postal service name will appear as a link on the alphabetize page.
Hiding your documents
Yous can unpublish
your website and hide your documents from browsers in the Net. Click on Unpublish your site
in the left-side carte to get to the Unpublish Your Site
web page.
The files will remain in place, however, and you tin still upload or delete them using the website assistants program, or through websites.cs.cf.ac.uk by STFP or CIFS/SMB.
Accessing your Web Site
One time you accept created and uploaded your site, and published it and fabricated it visible on the Internet, you can view your site at https://users.cs.cf.ac.u.k./MailName (where MailName
is your University or Computer Scientific discipline mail service name).
Rules for pages on the users server
Publishing on the users
website is a privilege offered to users inside Informatics & Informatics and it is your duty to treat this privilege responsibly and ethically.
Pages on the users
server are visible to the whole Internet and are subject to School Rules, University Regulations, the Regulations of the University's Cyberspace Provider (JISC), and legal restrictions regarding the propriety of their content. The Rules and Regulations include:
- Copyright
- Y'all must not publish copyright material or material that is otherwise restricted.
- Reputation
- You lot must not publish material which might bring yourself, the School of Informatics & Informatics or Cardiff Academy into disrepute.
- Authenticity
- Y'all must not purport to be anyone other than who you are on your web pages.
- Privacy
- Respect the privacy of others. Avert cloth about private individuals unless you lot have their permission.
- Sensitivity
- Think advisedly before publishing fabric nigh existent events. Try not to write annihilation that could be distressing to others.
- Complaints
- Take complaints nigh cloth on your spider web pages seriously. Respond to complainants quickly and politely. Be prepared to remove cloth if you cannot reach a resolution of the complaint.
- Security
- You must not install pages or software which damage the security or integrity of the web server or Academy network. Go along security in listen when writing web pages and applications. Take care when installing third-party applications in your website.
Pages that are considered to be inappropriate by the Head of School or his designated spider web masters will be removed without entreatment.
If you wish to create web pages that you lot don't want published on the Internet, utilize the projection
server instead of the users
server. The project
server is visible from within the School'south Intranet only - run across Creating a Web site on the School's Projection Web Server.
Types of Spider web Page - Documents and Scripts
We tin consider pages on a spider web server to be in four categories.
- Simple document pages
-
Files containing HTML text, images, etc which are formatted and displayed by the client browser (such as
Firefox
,Google chrome
,Konqueror
,Safari
orInternet Explorer
). You may write such documents directly - in a simple text editor, for example - or you may use a spider web authoring program. On the server, HTML files are namedsomething
.html. - Scripted Web pages
-
Pages generated on the fly past the server. The server understands the
PHP
scripting language (see https://world wide web.php.net). When you write a folio in PHP, the server executes the contents of the page and produces HTML which information technology sends to the browser. Again, y'all can write these yourself or use an authoring package to create them. PHP files are namedsomething
.php. The file oft consists of portions of HTML and PHP mixed together. Any PHP program portions in the file must begin with <?php and cease with ?>. Raw HTML portions are sent to the browser literally, as if they came from a .html file. - Common Gateway Interface (CGI) Scripts
-
Linux programs which produce HTML (in general) as their output when they run. These may be written in any computer language available on the Linux server (eastward.g. Perl, Shell, C, Java etc). CGI scripts follow a special protocol. In particular, the first affair they output must by a header which defines the sort of output that volition exist produced. CGI scripts should be placed in directory
cgi-bin
, or sub-directories of information technology, inside your web file space and the file must be executable. - Other Pages
-
If a file is not a .html or .php one, and information technology'due south not a CGI script in
cgi-bin
, then the server will ordinarily ship the contents of the file to the browser unchanged. The file name is passed to the browser and it uses this to decide how to brandish or save the file. For instance, the server may send PDF files, MS Give-and-take documents, PostScript files etc. Spider web browsers are often equipped to deal with these. Sometimes a browser has built-in functions to handle a non-HTML folio, or information technology may run a so-called plugin or external awarding, or information technology may simply save the file onto the local computer.
An Instance HTML Alphabetize Page
Here is an instance of an elementary HTML file and the web folio it produces.
<championship>My start document</title>
<h1>A heading</h1><p>Text can be plain, <strong>bold</stiff> or <code>italic</code>. There can be images included</p>
<p><img src="/epitome/y_ddraig_goch.gif" /></p>
<p>and links to other pages like <a href="https://users.cs.cf.ac.uk/">here</a> to the main user-supplied pages.</p>
Preventing list of directory contents
When you visit directory in your site, the browser will list the contents of the directory.
This is generally undesirable. It'due south better to accept a file called index.html or index.php in your website's directory. A file with i of these names volition be displayed by default when the accost that'south requested is a website directory.
And then, if the user above renamed file first.html every bit index.html, the elementary html file would be displayed by default and no directory listing would appear. Yous tin can rename files using the website administration program, or an STFP or CIFS/SMB application.
Secure mode
The users
server also has a secure HTTPS
manner which you can employ, for example, if you lot desire the browser to send passwords or other valuable data to the server. Secure URLs are the same equally ordinary ones but with https:
in place of http:
.
Running CGI scripts
Executable files in the cgi-bin
directory in your web file space tin can be accessed using URLs of the form https://users.cs.cf.ac.uk/MailName/cgi-bin/ followed by the file name, where MailName
is your University postal service name.
At that place is a maximum CPU fourth dimension allocated to scripts executing on the users
server. After this has been reached, the program is terminated. Whatsoever HTML which it has produced is flushed to the client browser but no error message or indication of termination is given.
Reading and Writing Files
CGI scripts and scripted web pages tin can access files in the Linux file system on the users server. If you want your script or page to admission a file called site.log, say, in your website directory, you can specify the full pathname of the file equally /usr/local/www/user/MailName/site.log, where MailName
is your University postal service name.
This pathname is the name of the file in the Linux Domain
. This means that the web server looks on its local file system for the file.
Note that files in /usr/local/www/user/MailName/ are accessible to web users using a Web Domain
address starting https://users.cs.cf.ac.uk/MailName/.
If you don't want people to come across the file, you will need to protect it with a .htaccess file. I way to do this is to create a split up directory for files which are used directly by scripts and pages that is protected the directory against spider web access.
Use the website administration programme, STFP or CIFS/SMB application to create a directory called files
, say, so that the Linux Domain path for the file would be /usr/local/www/user/MailName/files/site.log. Now create an access command file called .htaccess in the files
directory. The access command file should comprise:
guild deny allow
deny from all
This will prevent whatever files in the directory from existence accessed over the Web but won't finish your pages or scripts from accessing them in the Linux Domain.
Referring to Other Documents
When your pages refer to other documents on the users
server, for example in a HREF link or an IMG specification, it is ameliorate to use a relative URL rather than an absolute one. So, yous tin (and should) miss out the https://users.cs.cf.ac.uk office considering the server will automatically make full in its own address.
Similarly, you tin can miss out the directory hierarchy if the document yous want is in the same directory as the ane existence read. So, to refer to a page other.html in your website directory from your alphabetize page, use the URL other.html instead of https://users.cs.cf.ac.united kingdom of great britain and northern ireland/MailName/other.html.
Use the full URL if you lot are referring to an external
page on another server. For instance use https://docs.cs.cf.ac.united kingdom/ to refer to the home page on the Schoolhouse's Documentaion and Facilities website.
Server-side Includes
It is possible to include directives within your documents which cause a program to be run on the server. This is similar to using a CGI script except that the HTML information technology outputs is included in the document existence displayed instead of creating a split web page.
The program or script to be run tin be in your cgi-bin
directory, or other accessible certificate directory.
For example, suppose y'all want to include the CGI script count.cgi which is in your cgi-bin
directory. Put the following directive in your document.
<!--#exec cgi="cgi-bin/count.cgi"-->
The server will not look for the directive unless the document file access modes are set to exist executable. (This is for performance reasons, it prevents the web server from scanning files unnecessarily). You tin can prepare the mode using the website assistants program.
Source: https://docs.cs.cf.ac.uk/notes/uploading-and-publishing-your-own-web-site/
0 Response to "Html Page Upload to Server in Index.html Vs Cgi"
Post a Comment