Where do I put hidden files / directories?


#1

I want to upload some java classes, and access / run them from the page, but I don’t want the visitor to see the different directories or files? Where do I put them? Say if I have a text area and submit button, but button runs the text through my java applications and returns a new page, how do I make it so the visitor sees only the text area page and the returned page? thx :slight_smile:


#2

In your home directory, anywhere but your domain directory.


yerba# rm -rf /etc
yerba#


#3

how do I get to my home directory?


#4

when i start up FireFTP in Firefox, it starts out at “/” then I have to chage down to my domain for the files I want to be seen. Is the “/” my home directory?


#5

It depends on context. To a web browser, “/” represents your web root directory. It acts in the same way as http://domain.com/.

From the perspective of PHP, however, “/” means something different. It is referring to the absolute path (also called relative from root). On a Windows system, that would be the same as “C:”, but on the Linux system used by DreamHost it means the root directory.

If you were trying to “include” a file from a directory called “includes” in your web root, with PHP for example, you might try to do it like this:

<?php include("/includes/file.php"); ?>That doesn’t work, because it is using the wrong “/” as a reference. Instead, you would need something like this:

<?php include("/home/username/domain.com/includes/file.php"); ?>In fact, it would be better to do it like this:

<?php include($_SERVER['DOCUMENT_ROOT']."/includes/file.php"); ?>That is because $_SERVER[‘DOCUMENT_ROOT’] is a special environment variable that holds the absolute path to your web root. It is always available on Apache systems, and it means that you can safely move your site around from one host to another without worrying about differing file structures.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#6

well, it’s still unclear. I mean when i log into my ftp account, the remote setting is “/” and then underneath is my domain, along with logs and Maildir. So is that initial “/” FireFtp’s shorthand for my /home/username directory? and is this the directory that I can install the files/pages/services that the visitors won’t be able to access? thx


#7

and to clarify, FireFTP is not exactly a web browser, it’s an extension to firefox. it just runs in a new tab, that’s all. thanks again


#8

Sorry.

Yes, I have used FireFTP. Like all FTP clients, FireFTP will connect you to your personal directory. In otherwords, it connects you to:

/home/username/You cannot access “/home/”, but you can certainly put files in your personal directory that will not be visible to the outside world. So you can always create a directory in there called “hidden”, which your scripts (and only your scripts) can access with:

/home/username/hidden/Does that answer your question?


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#9

but wait, do i have to call it “hidden/” to keep it hidden? or does anything I put in there can only be accessed by my own scripts? thx so much, you’re the best :slight_smile:


#10

i’m trying to emply google’s api, i just uploaded /soap/com/google/soap/search directory with several files? Would you give me some php help? say I have a text box and submit button. what is a line of code that would send the text to the applicable class in the above directory, run the java class, and return a simple “working” test line back to the viewer? I’ll get started on it, maybe I can figure it out for myself…


#11

Nope. The folder can be called “ooohh_you_cannot_see_me” if that is your desire.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#12

I have absolutely zero knowledge of Java; however, the DreamHost wiki has a handy PHP tutorial, which can be combined with the PHP form processing tutorial to get the information you need.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#13

In the context you’re thinking, yes.

However, as I’m sure was stated earlier, on standard unix “/” is the root file system. Your home would technically be /home/ where is your FTP login name.

There is just a wrapper (known as chroot for unix folks) that makes your FTP client think / is home when in reality it is /home//


yerba# rm -rf /etc
yerba#


#14

you’re the best. hopefully one day i can aim some business your way.


#15

Google’s API files is Java?

I can tell you right now, you cannot run Java web files on the DreamHost servers. That requires a JSP Server, which there is none running (Tomcat if you’ve herd of it).

I thought Google’s API was merely a SOAP interface, accessible by any language with SOAP libraries. I think you’re going off onto the wrong path here.


yerba# rm -rf /etc
yerba#


#16

well, the DH files say “no J EE” but that applets and regular java are fine. what i want to do is send data as arguments to a java application which will filter the results back to the page somehow… I cant do that?


#17

If the Java Application is built to be ran on the command line with arguments, you can do that. I thought you were wanting to run some Java server request, which you cannot. DH doesn’t have any Java servers running. But the Java client is fully functional. It’s version 1.5.0_02b9 in case you wanted to know.


yerba# rm -rf /etc
yerba#