Visit Our UNIX and Linux User Community

Full Discussion: Is this possible?
Top Forums UNIX for Advanced & Expert Users Is this possible? Post 26087 by norsk hedensk on Monday 12th of August 2002 12:31:34 AM
Old 08-12-2002
yes it is, i think understand what you are trying to say. we can say that your http server root is /usr/local/httpd/htdocs/ this is the directory where your index.html and the rest of your website is stored, when someone goes to the page they will see is index.html and will look to them in actuality this is located on the server in the directory /usr/local/httpd/htdocs -- that make sense? just trying to laydown the basics. ok so you want to move the contents of /usr/local/httpd/htdocs/ into the root directory of your server, / (i have to ask though why you would want to do that it will just clutter up a nice neat filesystem.) so to do this via telnet, (one more thing id recomend that you ditch telnet and use ssh for your remote shell access) so you login to your server from telnet, you cant login as root, you can enable root logins but this is a BADDDDD idea, root logins are disabled by default by most systems i believe. so you login to telnet with your user name, _yourname_ put in your password and now you are at your prompt. if you have your permissions set for the /usr/local/httpd/htdocs/ that makes you the owner, actually wait, you want to move it to / ok so first thing to do is enter this command:
su -
you will be prompted for a password, enter your root password, the su with the - makes su Switch User to root, (if no name is specified) the "-" makes su act as a login shell, (is convienient when you want to check root's mail when logged in like this) then cd to /usr/local/httpd/htdocs/
then enter the command:
cp *.* /
MAKE sure that you are in the directory of the files that you want to move, /usr/local/httpd/htdocs/ is just an example, your htdocs forlder may be somwhere else or you may be using a different name and place altogether for the server root directory. then you are done.
this is a very simple proccess but i tried to be as descriptive as possible, well, have fun.
Test Your Knowledge in Computers #415
Difficulty: Easy
HTML, CSS, and JavaScript are the three core technologies of the World Wide Web.
True or False?
Plack::Middleware::Static(3pm)				User Contributed Perl Documentation			    Plack::Middleware::Static(3pm)

Plack::Middleware::Static - serve static files with Plack SYNOPSIS
use Plack::Builder; builder { enable "Plack::Middleware::Static", path => qr{^/(images|js|css)/}, root => './htdocs/'; $app; }; DESCRIPTION
Enable this middleware to allow your Plack-based application to serve static files. If the given request matches with the pattern defined in "path", this middleware will try to locate the file in "root". If the file exists it will be served but otherwise 404 response will be returned. See "pass_through" option below to change this behavior. If the requested document is not within the "root" (i.e. directory traversal) or the file is there but not readable, a 403 Forbidden response will be returned. The content type returned will be determined from the file extension based on Plack::MIME. CONFIGURATIONS
path, root enable "Plack::Middleware::Static", path => qr{^/static/}, root => 'htdocs/'; "path" specifies the URL pattern (regular expression) or a callback to match with requests to serve static files for. "root" specifies the root directory to serve those static files from. The default value of "root" is the current directory. This examples configuration serves "/static/foo.jpg" from "htdocs/static/foo.jpg". Note that the matched "/static/" portion is still appears in the local mapped path. If you don't like it, use a callback instead to munge $_: enable "Plack::Middleware::Static", path => sub { s!^/static/!! }, root => 'static-files/'; This configuration would serve "/static/foo.png" from "static-files/foo.png" (not "static-files/static/foo.png"). The callback specified in "path" option matches against $_ and then updates the value since it does s///, and returns the number of matches, so it will pass through when "/static/" doesn't match. If you want to map multiple static directories from different root, simply add "this", middleware multiple times with different configuration options. pass_through By turning on this option, this middleware will pass the request back to the application for further processing, if the incoming request path matches with the "path" but the requested file is not found on the file system. AUTHOR
Tokuhiro Matsuno, Tatsuhiko Miyagawa SEE ALSO
Plack::Middleware Plack::Builder perl v5.14.2 2011-06-22 Plack::Middleware::Static(3pm)

Featured Tech Videos

All times are GMT -4. The time now is 12:44 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy