LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 08-22-2008, 03:14 PM   #1
nighttraindb
LQ Newbie
 
Registered: Aug 2008
Posts: 18

Rep: Reputation: 0
Question How to load an index.htm file to replace IT WORKS! :)


Ok, through alot of trial and error and having others correspond I have learned how to ftp by Slackware 12.1 Linux Server...

Now, I did a "mkdir" for www and so on. My problem is I then proceeded to place an index.html file in the www folder assuming it would replace the "it works" page that comes up. I then proceeded to type in the ip address and do not get the page I loaded.

Where do I place the index file, and for that matter the rest of them...

Thanks
 
Old 08-22-2008, 03:41 PM   #2
Cuetzpallin
Member
 
Registered: Feb 2008
Location: Monterrey, MX
Distribution: Slackware since 3.4 and love it!!!
Posts: 162

Rep: Reputation: 31
Quote:
Originally Posted by nighttraindb View Post
Ok, through alot of trial and error and having others correspond I have learned how to ftp by Slackware 12.1 Linux Server...

Now, I did a "mkdir" for www and so on. My problem is I then proceeded to place an index.html file in the www folder assuming it would replace the "it works" page that comes up. I then proceeded to type in the ip address and do not get the page I loaded.

Where do I place the index file, and for that matter the rest of them...

Thanks
Did you make a default full install?

you could look under /srv/httpd/htdocs or /srv/www/htdocs
 
Old 08-22-2008, 04:31 PM   #3
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Peppermint
Posts: 2,738

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
On Slackware 11 the directory is: /var/www/htdocs. Don't think this has changed.
 
Old 08-22-2008, 05:39 PM   #4
nighttraindb
LQ Newbie
 
Registered: Aug 2008
Posts: 18

Original Poster
Rep: Reputation: 0
First, thank you guys no htdocs?

Ok, I have loaded this as an image file to dvd, installed it then wiped it clean figuring I was doing something wrong. Had a "guru", just someone that knows his stuff explain to me in a letter step by step what to do. Everything worked perfect UNTIL I was told
to type cd /var/lib/htdocs no such directory?

I understand I am being asked to change directories here... however I am at a loss as to why it was not installed. I did choose the automated full install. I am wondering if for some reason one of those menu settings that required an asterisk I overlooked.

At any rate can I just make these directories? Or are their special files there that are neccessary...

I mean I goto another computer and type in the ip and get IT WORKS!

Thanks
 
Old 08-22-2008, 05:48 PM   #5
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282

Rep: Reputation: 61
The httpd server has a configuration file: /etc/httpd/httpd.conf
The httpd default directory is defined in DocumentRoot directive in this file
 
Old 08-22-2008, 06:47 PM   #6
nighttraindb
LQ Newbie
 
Registered: Aug 2008
Posts: 18

Original Poster
Rep: Reputation: 0
Keefaz

Thank You for responding, unfortunately this is greek to me. I suppose if you have the time could you tell me exactly what to type
at the root@... prompt?

Right now I am just trying to get things up and running so that I can toy around and read... get a feel for Linux... thanks.

Example: This gentleman who I unfortunately am only able to communicate with via snail mail informed me that if I could not ftp I had to remove the "#" sign from proftpd line... if I was not told that in laymans terms I would have never figured it out...

Thanks again, for the assistance you have already given.
 
Old 08-22-2008, 07:45 PM   #7
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282

Rep: Reputation: 61
Well a quick command would be:
Code:
grep  '^ *DocumentRoot' /etc/httpd/httpd.conf
But try to learn how to display/edit text files on the console, that would help a lot
 
Old 08-22-2008, 08:39 PM   #8
nighttraindb
LQ Newbie
 
Registered: Aug 2008
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks Again Keefaz

Thanks for pointing me in the right direction.
 
Old 08-23-2008, 01:45 AM   #9
nighttraindb
LQ Newbie
 
Registered: Aug 2008
Posts: 18

Original Poster
Rep: Reputation: 0
Ok, last question :) found the htdocs...

Ok, I managed to now ftp

srv/httpd/htdocs

And just figured I would drag the index file I made overtop of the current one.

However when I try I get the following response.
Unable to transfer
This is most likely due to insufficient permissions. Verify both the destination and permissions, then try again...

I suppose I will need the exact code that would grant permissions. Unless for some reason replacing that file is a big no no.

Thanks Again
 
Old 08-23-2008, 04:31 AM   #10
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282

Rep: Reputation: 61
I don't know if it is a typo error but it is /srv/httpd/htdocs, not srv/httpd/htdocs
I would suggest to edit httpd.conf to assign a new directory for DocumentRoot, this way your html files won't be deleted with a httpd upgrade. You have to change the corresponding directory block as well
(<Directory "/srv/httpd/htdocs">) in httpd.conf
 
Old 08-31-2008, 08:00 AM   #11
nighttraindb
LQ Newbie
 
Registered: Aug 2008
Posts: 18

Original Poster
Rep: Reputation: 0
Kefaz

Keefaz first thank you. And I completely understand if you do not have the time for this. I just figured it could not hurt to ask.

Basically, I am just looking for what (command) I will need to type at the root #...

So, I can point the server to my index.htm file instead of the default one that keeps coming up. Unfortunetely, I am just not versed enough on Linux to type in the commands to go here or there on my own.

Below is the instructions I was given and I followed this to the letter.

Again, thanks for everything and if you just do not have the time it is completely understandable.



Boot from DVD

1 When the ISOLINUX screen comes up, you should be able to simply press enter. if
you get an error, reboot, type: huge.s (at the prompt press enter)
2. When asked for a keyboard map or something of the sort, press enter (twice)
3. You should be at a prompt ending in a # sign. If not, figure out what went wrong

4. time to wipe your hard drive or atleast enough to tell it it's wiped. type the following:
dd if=/dev/zero of=/dev/hda bs=1024 count=2048
then press enter. You should see something about records out/in Two lines if no
errors proceed.
5 Type cfdisk /dev/hda
You may be asked a question if so type y and press enter.
6 An interface will showup. It should show "Free Space" the size the drive on a line. If
it says NTFS or FAT32, use the arrows to select them and press the "delete" button.
7 Highlight "New" and press enter.
Choose "Beginning" and "Primary" when asked
8 When asked for a size, in MB, a value will be shown subtract 2000 from what it shows
(you'll have to type the new value) and hit enter.
9. You should have Linux and Free space now showing. Highlight the Linux one and highlight
"bootable" and press enter so a "B" or "Boot" shows on that line.
10 Go down to the free space and repeat steps 7 and 8 except just leave the size as it says this
time.
11 Highlight the smaller partition, then highling "Type" and press enter several times until
you end up back at the list of commands. That line should now say "Linux Swap"
12. Assuming all is well highlight "Write" and press enter Type "yes" and press enter. When
it's done goto "quit"and press enter.
13. Back at the # prompt, type "setup" and press enter.
14. Scroll to "ADDSWAP" and hit enter. Enter 3 times... wait for it to finish.
15 Press enter 4x should be formatting hda1 in ext3 or so now wait...
16 Press enter 3x... wait for it to find the CD
17 Enter 2x... wait for everything to install.
18 Choose to skip making a USB stick
19 No Modem
20 Choose simple LILO
21 Choose the last option 1024 x 768 x 64k
22 Press enter when asked what to append to the kernel
23 Chose MBR wait...
24 Choose PS2 mouse
25 Choose yes to load at boot.
26 Yes, configure network
27 in the hostname box type vfi1 and press enter
28 For domain, type voiceforinmates.com press enter
29. Choose Static IP
30 Enter one of your open IP's (got it) and press enter.
31 enter your netmask should be 255.255255.0.....
32 Enter your gateway address....
33 Yes to nameserver
34 Enter your ISP's nameserver IP ( *** now I am assuming he means primary DNS)
35. Press Accept
36 in the list (enable) the following (using the space bar)
rc.bind, rc.cups, rc.httpd, rc.inetd, rc.messagebus, rc. mysqld, rc.sendmail, rc.syslog,
rc.sshd. Disable rc.pcmcia press enter
37 No custom fonts
38 No hardware clock is st to local time
39 US / Eastern
40 xinitre.kde
41 Yes, set root password. Follow instructions for setting a password.
47 Done. Pres enter got to exit remove cd reboot

Now, if all went well. You now have a linux machine running. You should be able to
goto http://ipaddres you gave and see "IT WORKS!" come up, to show that the
server well, is working..

However it's pretty stripped and does nothing yet. Let's get you basic access to hosting
so that you can (right now) start hosting files locally. Not the whole site yet, because
that'll require DNS setups and such...

So, on your scren should be a bunch of text, probably an error from mysql. Hit enter a
couple of times you should see vfi1 login: type root and press enter.
You should have a randome "fortune" followed by root@vfi1# this is where the fun
happens.

Type adduser (oneword). press enter
Type VFI for username press enter press enter for everything until you are asked
for a password. (not the same as root)

When you get back to the # prompt type
chmod 755 /home/vfi (press enter)
su vfi (press enter)
mkdir /home/vfi/www (press enter)
exit (press enter)
cd /var/lib/htdocs (press enter)
ln -s /home/vfi/www ./vfi (press enter)

ok after all that you should be able to ftp your machine..

Now, I had to pico /etc/inetd.conf and remove the # sign from the front of the proftpd
line.
Then ctrl x, y, enter

Then type killall -HUP inetd (press enter)
/etc/rc.d/rc.inetd restart (press enter)
 
Old 08-31-2008, 08:28 AM   #12
Robhogg
Member
 
Registered: Sep 2004
Location: solihull.w-mids.uk
Distribution: Debian 5.0, CentOs, Solaris 8-10
Posts: 573

Rep: Reputation: 58
You may find an online handbook such as the the Rute User's Tutorial and Exposition useful. While it is not right-up-to-date, it is very comprehensive. Chapter 36 covers Apache, chapter 6 covers editing text files, chapter 14 covers file permissions, and so on. You can either read it online, or download as a pdf file or html archive.
 
Old 08-31-2008, 11:30 AM   #13
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282

Rep: Reputation: 61
Look like you want the DocumentRoot in /home/vfi/www right ?
Is it in /home/vfi/www that you want to put index.html file ?
if yes, try as root:
Code:
cp /etc/httpd/httpd.conf /etc/httpd/httpd.conf.bak
sed -i -e 's#/srv/httpd/htdocs#/home/vfi/www#g' /etc/httpd/httpd.conf
/etc/rc.d/rc.httpd restart
This is quick solution, but it should not replace a learning experience in editing conf files in the console...

[edit]
The sed replacement command will work only if you have not yet edited the DocumentRoot and <Directory "/srv/httpd/htdocs"> in httpd.conf, eg you have the stock slackware httpd.conf

Last edited by keefaz; 08-31-2008 at 11:35 AM.
 
Old 08-31-2008, 01:23 PM   #14
nighttraindb
LQ Newbie
 
Registered: Aug 2008
Posts: 18

Original Poster
Rep: Reputation: 0
Keefaz! Man Thank You

Hey that did the trick, believe me I understand that I need to get an understanding of this and intend on reading about it in depth over the next few weeks...

I just needed to atleast get the ball rolling, get pages moved over... and this certainly starts it for me. Again, thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the default webpage configuration from index.php to index.htm, etc meema Linux - Server 4 08-22-2008 09:06 PM
index.htm on apache redice Linux - Software 2 04-30-2006 03:09 PM
index.htm doesn't open instead it show up merlin740 LinuxQuestions.org Member Success Stories 2 10-04-2004 12:08 PM
Help with Apache & index.htm idev Linux - Networking 3 09-18-2003 09:58 AM
Help with Apache & index.htm joe_dejesus Linux - Networking 9 08-29-2001 01:20 PM


All times are GMT -5. The time now is 06:01 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration