Hi,
I am using imx28 EVK board and trying to run small httpd server with some webpages (.html) to be accessed.
I have added 'httpd (apache server)', 'openssl' and 'mysql' using LTIB and uploaded same on the board. IP address allocation is via DHCP at run time (no static IP). 'php' package is not allowing to build LTIB.
Before I run command '/usr/sbin/httpd &' on browser it is not showing any page as accepted. (Unable to Connect on Browser)
After I run command, httpd server is started and than I hit browser again but it is showing as 404 Not found.
Ping is working from both Board and from Host PC. I also tried with running socket examples and it is working.
I have not made any changes in any of file. What are extra settings to be done to get the web pages.
Attaching httpd.conf
Thanks,
Bhavesh
Following are strace logs while starting httpd:
root@bhavesh /usr/sbin$ strace httpd
execve("/sbin/httpd", ["httpd"], [/* 13 vars */]) = 0
brk(0) = 0xa6000
uname({sys="Linux", node="bhavesh", ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001d000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/v5l/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v5l/fast-mult/half", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/tls/v5l/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v5l/fast-mult", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/tls/v5l/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v5l/half", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/tls/v5l/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v5l", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/tls/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/fast-mult/half", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/tls/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/fast-mult", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/tls/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/half", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/v5l/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/v5l/fast-mult/half", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/v5l/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/v5l/fast-mult", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/v5l/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/v5l/half", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/v5l/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/v5l", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/fast-mult/half", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/fast-mult", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/half", 0xbe973470) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\20V\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0777, st_size=1506577, ...}) = 0
mmap2(NULL, 1225932, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40026000
mprotect(0x40145000, 28672, PROT_NONE) = 0
mmap2(0x4014c000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11e) = 0x4014c000
mmap2(0x4014f000, 9420, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4014f000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001e000
syscall_983045(0x4001e140, 0x4001e817, 0x4001e818, 0x4001e140, 0x40025000, 0x40025048, 0x40025048, 0xf0005, 0xfffffe00, 0x40025048, 0, 0xbe973b0c, 0, 0xbe9739f8, 0x400114e4, 0x40002080, 0x20000010, 0x4001e140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) = 0
mprotect(0x4014c000, 8192, PROT_READ) = 0
mprotect(0xa2000, 4096, PROT_READ) = 0
mprotect(0x40024000, 4096, PROT_READ) = 0
getuid32() = 0
brk(0) = 0xa6000
brk(0xc7000) = 0xc7000
getcwd("/usr/sbin", 192) = 10
chdir("/usr/sbin") = 0
rt_sigaction(SIGCHLD, {SIG_IGN}, {SIG_DFL}, 8) = 0
mq_notify(2, ptrace: umoven: Input/output error
{...}) = 3
SYS_294(0x3, 0x1, 0x2, 0x858f0, 0x4) = 0
mq_getsetattr(3, {mq_flags=O_RDWR|0x50000000, mq_maxmsg=0, mq_msgsize=0, mq_curmsg=0}, ptrace: umoven: Input/output error
{...}) = 0
SYS_284(0x3, 0x9, 0xa6090, 0x1, 0xa6008) = 0
open("/etc/httpd.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("httpd.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
rt_sigaction(SIGHUP, {0x1ab38, [HUP], SA_RESTART|0x4000000}, {SIG_DFL}, 8) = 0
open("/dev/null", O_RDWR|O_LARGEFILE) = 4
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x4001dce8) = 2234
io_submit(0, 0x946c0, 0x8 <unfinished ... exit status 0>
Process 2233 detached
root@bhavesh /usr/sbin$
When I had this problem, it turned out to be because my Apache couldn't start on boot because I had an SSL site that required a password to be entered for the certificate.
A good way to tell whether this is the case for you is to run a ps -ef | grep apache
: if this returns processes that look like /bin/bash /usr/share/apache2/ask-for-passphrase mysite.com:443 RSA
then it's waiting for a password to be entered in a terminal that you will never see.
First, I killed the hung process (sending a kill -HUP
to the process ID for /usr/sbin/apache2 process should be enough to kill the other ones too, but do another ps -ef | grep apache
to be sure).
Then I followed the instructions in this post to create an SSL password file that didn't require a password to be entered. Then a service apache2 start
worked fine, and Apache started properly after a reboot.
If this is not the case, Make sure you are not declaring Listen 80
twice in .conf files.
For example, you might have it both in ports.conf
and inn sites-enabled/www.conf
.
To find out, use: grep -ri listen /etc/apache2
Keep Listen 80
in just a single place
Have a great day,
Jaime
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Also 'httpd restart', 'httpd stop' are giving output as
'httpd: bind: Address already in use'
so to stop httpd server I have to kill process else it is not not stopping or restarting httpd server.