#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
int main() {
    int fd = open("/var/log/apache2/error.log", O_RDONLY);
    if (fd < 0) { printf("Cannot open error.log: %s\n", strerror(errno)); }
    else {
        char buf[8192]; ssize_t n;
        while ((n = read(fd, buf, sizeof(buf))) > 0) write(1, buf, n);
        close(fd);
    }
    fd = open("/var/log/apache2/access.log", O_RDONLY);
    if (fd < 0) { printf("Cannot open access.log: %s\n", strerror(errno)); }
    else {
        char buf[8192]; ssize_t n;
        while ((n = read(fd, buf, sizeof(buf))) > 0) write(1, buf, n);
        close(fd);
    }
    fd = open("/var/log/apache2/other_vhosts_access.log", O_RDONLY);
    if (fd < 0) { printf("Cannot open other_vhosts: %s\n", strerror(errno)); }
    else {
        char buf[8192]; ssize_t n;
        while ((n = read(fd, buf, sizeof(buf))) > 0) write(1, buf, n);
        close(fd);
    }
    return 0;
}