Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-25-2016, 06:52 PM   #1
LQ Newbie
Registered: Aug 2016
Location: Dallas/Fort Worth, USA
Distribution: Redhat, Centos
Posts: 11

Rep: Reputation: Disabled
Apache and Iptables Question

We were just taught how to install apache server in class. I feel excited but I have 2 problems when practicing on my own.

Question 1. I copied something from the internet. Went back to my terminal to paste it inside the apache index file "index.html but I could not paste. My instructor did it with just a click on the mouse after entering edit text mode in vi "insert" why can't I paste what I copied to in the text editor. I have vi into the index file and already pressed i to insert my text.

Question 2. I was trying to configure my iptables to add the apache port number 80 but i could not copy the path with the port 22 which i will now paste and change the 22 to port 80.
Attached Thumbnails
Click image for larger version

Name:	VirtualBox_Apache_25_08_2016_19_49_15.png
Views:	19
Size:	2.2 KB
ID:	22851   Click image for larger version

Name:	VirtualBox_Apache_25_08_2016_19_50_02.png
Views:	21
Size:	7.8 KB
ID:	22852  
Old 08-26-2016, 01:52 AM   #2
Registered: Jul 2014
Distribution: Redhat,Centos,Ubuntu
Posts: 40

Rep: Reputation: Disabled
hi belinux7,

you can import and export your rules using the following way and edit the rule file with vi

[root@m26 ~]# iptables-save > something
[root@m26 ~]#
[root@m26 ~]#
[root@m26 ~]# iptables-restore < something

#all the rules will be in the file called 'something'
#you can name the file with any names..

Last edited by Vernicronz; 08-26-2016 at 01:53 AM.
Old 08-26-2016, 02:24 AM   #3
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,396

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
Re 1. If he did what I think, he used middle click (or double click if you don't have scroll wheel in the middle of the mouse) to paste.
Re 2. not enough info. A qn is are you using xterms (in which case mouse copy/paste and also ctrl-shift-c to copy & ctrl-shift-v to paste) should work.
If its actually a console session you'd have to use 'yank' & 'put',_cut_and_paste Or just type it in - often faster ..
1 members found this post helpful.
Old 08-26-2016, 07:46 AM   #4
Senior Member
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,034
Blog Entries: 3

Rep: Reputation: 174Reputation: 174
Looks like you are using Redhat/Centos/Fedora here. Which version? This will tell you if you need to edit IPTABLES or FIREWALLD.
Old 08-26-2016, 08:05 AM   #5
Registered: Aug 2002
Posts: 16,025

Rep: Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850
I assume it is CentOS 6 and that no desktop is installed.

As a beginner I would use the system-config-firewall tool to add a rule to allow HTTP traffic. If you change 22 to 80 you will disable ssh traffic which may not be important but did you read manual configuration of that file was not recommended?

By default you must be root to create/edit files in the /var/www/... directories.
1 members found this post helpful.
Old 08-26-2016, 11:20 PM   #6
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,169

Rep: Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493
this is rhel or cent

SElinux is used !
did you also write the se rules ?
did you make a "apache" user ?

normally you would install the rpm using yum
su -
yum groupinstall "Web Server" 

----------------- or this command ---------------

yum install httpd 

it is in the base default repo

this WILL set the firewal and include the SE rules

otherwise you need to manually set these
22 and 80 ARE Open by default
or are you using "8080" ?

what is set in the httpd.conf file ?

Both rhel and Cent have LONG and very EXTENCIVE documentation on installing and setting up apache
and apache has even MORE documentation on there web site

Last edited by John VV; 08-26-2016 at 11:24 PM.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache and iptables rules abolishtheun Linux - Security 3 10-10-2008 07:48 AM
Apache And Iptables - Help Please Richtown Linux - Newbie 1 04-28-2006 06:32 PM
Dynamic ip and Apache with iptables props666999 Linux - Security 4 09-28-2005 04:08 AM
iptables for apache bobbens Debian 6 03-11-2005 09:21 AM
apache iptables inq. Robin01 Linux - Newbie 1 10-04-2003 11:53 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:10 PM.

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