LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-25-2016, 07:52 PM   #1
belinux7
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:	17
Size:	2.2 KB
ID:	22851   Click image for larger version

Name:	VirtualBox_Apache_25_08_2016_19_50_02.png
Views:	17
Size:	7.8 KB
ID:	22852  
 
Old 08-26-2016, 02:52 AM   #2
Vernicronz
Member
 
Registered: Jul 2014
Distribution: Redhat & Centos
Posts: 31

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 02:53 AM.
 
Old 08-26-2016, 03:24 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,254

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
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' http://vim.wikia.com/wiki/Copy,_cut_and_paste Or just type it in - often faster ..
 
1 members found this post helpful.
Old 08-26-2016, 08:46 AM   #4
lazydog
Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 829
Blog Entries: 1

Rep: Reputation: 137Reputation: 137
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, 09:05 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,245

Rep: Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624
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-27-2016, 12:20 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,985

Rep: Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447
this is rhel or cent
so

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

normally you would install the rpm using yum
Code:
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
BUT
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
https://httpd.apache.org/docs/2.4/

https://access.redhat.com/documentat...erprise-linux/

Last edited by John VV; 08-27-2016 at 12:24 AM.
 
  


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



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


All times are GMT -5. The time now is 08:36 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration