Apache2 won't start

After making some minor changes to the options of EHCP, apache2 no longer works. I tried to type service apache2 start in terminal as well as using force-reload, ect. to boot apache again but it didn't work. The terminal error is as shown here:

root@ubuntu-server:~# service apache2 start
* Starting web server apache2 (99)Cannot assign requested address: make_sock: could not bind to address XX.XX.XX.XX:80
no listening sockets available, shutting down
Unable to open logs
[fail]
root@ubuntu-server:~#

What could be the problem?

You have two problems:

  • some other process might still be using port 80. try to kill it. you may try "killall apache2". That may be another process too. you need to find it. netstat -anp | grep 80
  • you have something in apache config, most probably in apachehcp.conf file, in ehcp dir, that references to a log file, which does not exist or cannot be initialized. this happens when someone deletes directories manually. examing apachehcp.conf, then, delete those configs, or re-setup those dirs/logfiles.

    alternatively, you may login to mysql ,
    then, delete those un-needed domains,
    then
    insert into operations (op) values ('syncdomains');
    that will re-build configs.

  • I did manually delete a folder lately because of unauthorized shell access to my machine. How can I login to MYSQL without phpmyadmin?

    Apparently the folder I deleted was for an FTP account only. How would I then go about that?

    as I said, two ways, choose one:
    1- setup that directory again, in command line, then, restart apache,
    2- delete that domain in mysql, then, syncdomains

    Unfortunately, I don't remember the directory. What I was asking was how to connect to MYSQL without Phpmyadmin, as I've only used Phpmyadmin in the past.

    should be server ip /phpmyadmin

    example. 66.202.87.102/phpmyadmin

    With apache not working Phpmyadmin won't work either.

    true, sorry i missed that. then u have to go to console, type mysql

    then ur in mysql server mode

    I got into mysql mode, however, I don't know anything about what commands are used in the MySQL command line and how they're used.

    Heres a good reference, what are you trying to do?

    http://www.pantz.org/software/mysql/mysqlcommands.html

    i fixed in this way:

    mysql -p
    insert into operations (op) values ('dofixapacheconfignonssl');

    do this if you dont use ssl.
    if you use ssl,
    insert into operations (op) values ('dofixapacheconfigssl');

    Try the following command:
    kill -9 $(pgrep apache2)

    Then:
    service apache2 start

    Then post the configuration error, if there is one. By the way, I think deleting a folder will only give you a warning.