LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-27-2016, 06:58 AM   #1
sysmicuser
Member
 
Registered: Mar 2010
Posts: 352

Rep: Reputation: 0
AWS Tech challenge Linux


Hi Guru's,

I just took challenge and I failed miserably!
I couldn't pass even first question. The challenge was something like this:

The server is restored after a crash and you have to make it up and running.

I was given url but I couldn't get the web server up and running,

Code:
[root@ip-10-0-193-152 rc3.d]# service httpd status
httpd is stopped
[root@ip-10-0-193-152 rc3.d]# service httpd start
Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/conf.d/mysite.conf: No such file or directory
                                                           [FAILED]
[root@ip-10-0-193-152 rc3.d]# ls /etc/httpd/conf.d/mysite.conf
/etc/httpd/conf.d/mysite.conf
I deleted line 221 but I got the error message below:
Code:
[root@ip-10-0-193-152 rc3.d]# ls /etc/httpd/conf.d/mysite.conf
/etc/httpd/conf.d/mysite.conf
[root@ip-10-0-193-152 rc3.d]# ls -l /etc/httpd/conf.d/mysite.conf
lrwxrwxrwx. 1 root root 36 Jul 27 05:04 /etc/httpd/conf.d/mysite.conf -> /data/vhosts/mysite/conf/mysite.conf
[root@ip-10-0-193-152 rc3.d]# ls -l /data/vhosts/mysite/conf/mysite.conf
ls: cannot access /data/vhosts/mysite/conf/mysite.conf: No such file or directory
[root@ip-10-0-193-152 rc3.d]# ls -l /data/vhosts/mysite/conf/mysite.conf
ls: cannot access /data/vhosts/mysite/conf/mysite.conf: No such file or directory
[root@ip-10-0-193-152 rc3.d]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       20G  2.5G   17G  14% /
tmpfs           498M     0  498M   0% /dev/shm
[root@ip-10-0-193-152 rc3.d]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       20G  2.5G   17G  14% /
tmpfs           498M     0  498M   0% /dev/shm
[root@ip-10-0-193-152 rc3.d]# vi /etc/httpd/conf/httpd.conf
[root@ip-10-0-193-152 rc3.d]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for ip-10-0-193-152.us-west-2.compute.internal
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Wed Jul 27 05:27:18 2016] [warn] NameVirtualHost *:80 has no VirtualHosts
                                                           [  OK  ]
[root@ip-10-0-193-152 rc3.d]# lsof -i tcp:4152
[root@ip-10-0-193-152 rc3.d]# lsof -i udp:4152
[root@ip-10-0-193-152 rc3.d]# lsof -i icmp:4152
I'm just trying to determine where I could have done better.
 
Old 07-27-2016, 07:15 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,388

Rep: Reputation: 408Reputation: 408Reputation: 408Reputation: 408Reputation: 408
Does /data exist, or it's unmounted perhaps?
 
Old 07-27-2016, 10:24 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,483

Rep: Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864
I am not sure why you have some commands and their outputs repeated, but my first thought after seeing a syntax error would not be to delete a line willy nilly ... did you look at line 221 to diagnose
what the error was related to? I assume the error relates to the symbolic link pointing to nothing which by deleting it has then caused the knock on error.

So as the administrator of the server (assuming this is the role the question has you in), you need to ascertain what has happened to the /data (or below) directory / mount point and restoring it so
conf file is available and httpd can be started (hopefully as it may not be only issue) successfully.
 
Old 07-27-2016, 05:30 PM   #4
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 8,113
Blog Entries: 11

Rep: Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239
ack. n/m.
I've been banging an CentOS httpd all day. I'm toast. Sorry.

Last edited by Habitual; 07-27-2016 at 05:55 PM.
 
Old 07-27-2016, 07:10 PM   #5
sysmicuser
Member
 
Registered: Mar 2010
Posts: 352

Original Poster
Rep: Reputation: 0
@keefaz

Quote:
Does /data exist, or it's unmounted perhaps?
Maybe, but I didn't knew at that moment how should I check that? df -h didn't had any mount point like /data should I have done cat /etc/fstab?
 
Old 07-27-2016, 07:56 PM   #6
sysmicuser
Member
 
Registered: Mar 2010
Posts: 352

Original Poster
Rep: Reputation: 0
@grail

Quote:
I am not sure why you have some commands and their outputs repeated, but my first thought after seeing a syntax error would not be to delete a line willy nilly ... did you look at line 221 to diagnose
what the error was related to? I assume the error relates to the symbolic link pointing to nothing which by deleting it has then caused the knock on error.

So as the administrator of the server (assuming this is the role the question has you in), you need to ascertain what has happened to the /data (or below) directory / mount point and restoring it so
conf file is available and httpd can be started (hopefully as it may not be only issue) successfully.
Correct, I did observe line 221, it was include conf.d/con* something like that. My first point was /data was missing and I dodn't how where to look or how to start doing troubleshooting. There was nothing like /data when I did df -h.

Always ready for challenges and this one was good one!
 
Old 07-27-2016, 10:28 PM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,483

Rep: Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864
I understand that /data is not mounted, but does it exist at all? It may simply be a directory created at the root level.
 
1 members found this post helpful.
Old 07-28-2016, 03:33 AM   #8
sysmicuser
Member
 
Registered: Mar 2010
Posts: 352

Original Poster
Rep: Reputation: 0
@grail

I agree, I id fail to look at root level directories under pressure. Better to look next time and stay cool.
 
Old 07-28-2016, 08:04 AM   #9
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,483

Rep: Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864
So ... are we good now? Does the path exist? If there but no file, maybe do a find to search for the file under /data ... might have been moved??
 
Old 07-28-2016, 11:17 PM   #10
sysmicuser
Member
 
Registered: Mar 2010
Posts: 352

Original Poster
Rep: Reputation: 0
@grail mate !
Yes it was local file system!! So yes you are right about /data, I took another challenge and got the same question ! Interesting thing is when I created file at actual directory the symbolic still was showing as broken one. Not sure if I should created a new symbolic link?
 
Old 07-28-2016, 11:54 PM   #11
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,483

Rep: Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864Reputation: 2864
So you created /data/vhosts/mysite/conf/mysite.conf but the link didn't take ... sounds a bit weird. I guess you could try creating a new link??
 
Old 07-29-2016, 08:22 AM   #12
sysmicuser
Member
 
Registered: Mar 2010
Posts: 352

Original Poster
Rep: Reputation: 0
Yes it does sound weird but weird practically too.
 
Old 09-20-2016, 03:46 AM   #13
raghu557
LQ Newbie
 
Registered: Sep 2016
Posts: 1

Rep: Reputation: Disabled
Smile Try the following

Hello,

Data directory needs to mounted here
please use the below commands

mount /dev/xvdc /data/
cd /data
cp -R vhosts /var/www/html/

now in the line 221 of httpd.conf file please comment the conf.d as there will be a symlink to the mysite.conf file.

Please try these out and let me know in case of any issue.

Regards,
Raghuram.
 
Old 09-22-2016, 07:59 AM   #14
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,715

Rep: Reputation: 4136Reputation: 4136Reputation: 4136Reputation: 4136Reputation: 4136Reputation: 4136Reputation: 4136Reputation: 4136Reputation: 4136Reputation: 4136Reputation: 4136
Quote:
Originally Posted by raghu557 View Post
Hello,
Data directory needs to mounted here please use the below commands

mount /dev/xvdc /data/
cd /data
cp -R vhosts /var/www/html/

now in the line 221 of httpd.conf file please comment the conf.d as there will be a symlink to the mysite.conf file. Please try these out and let me know in case of any issue.
...and this thread had been closed for two months at this point, since the user solved the issue. Further, you have NO IDEA if /data was a mount point at all, based on what was posted, so giving advice to 'mount' something that may not even exist, won't be of much help without details.
 
  


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
Amazon Web Services (AWS) and LInux validator456 Linux - General 3 05-08-2016 05:23 PM
LXer: Run Linux in the AWS cloud LXer Syndicated Linux News 0 06-20-2015 07:30 AM
Amazon AWS Linux servers usao Linux - Virtualization and Cloud 9 04-16-2015 11:40 AM
Can free Red Hat on AWS make it the de facto Linux for the cloud, too? jeremy Linux - News 0 06-11-2013 04:17 PM


All times are GMT -5. The time now is 01:59 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