ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    CentOS7 - Apache Virtual Hosts

    Scheduled Pinned Locked Moved IT Discussion
    44 Posts 4 Posters 8.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller @A Former User
      last edited by

      @Aaron-Studer said:

      Can I make it just not resolve?

      Again, why? Sure, you can make it error out, point it to nothing. But what is driving you to put in effort to make your site not as nice?

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User @A Former User
        last edited by

        @Aaron-Studer said:

        Can I make it just not resolve?

        You can make it go to a blank page I suppose but why? What are you trying to prevent?

        1 Reply Last reply Reply Quote 1
        • tonyshowoffT
          tonyshowoff @A Former User
          last edited by

          @Aaron-Studer said:

          Can I make it just not resolve?

          Yeah, just make it call either a file which does not exist (it will log in your error log though) or make it return the 404 header and the 404 html document that comes with Apache, that's essentially the same thing as "not resolving," assuming that's what you meant.

          1 Reply Last reply Reply Quote 1
          • ?
            A Former User
            last edited by A Former User

            What s the reasoning of wanting to block the ip address?

            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller
              last edited by

              You have some strong motivation here that you are not sharing. The Google thing isn't valid, that's not how search engines behave. It's not about being good for end users. It's not helpful to you. It's not a best practice. There is something you think you are accomplishing here that you are not willing to share with us. Do you believe this to be some kind of security problem?

              1 Reply Last reply Reply Quote 0
              • ?
                A Former User
                last edited by A Former User

                It just don't make since in my head to have a IP address resolve.... Only a domain. Maybe my head is the issue 😉

                ? scottalanmillerS tonyshowoffT 3 Replies Last reply Reply Quote 0
                • ?
                  A Former User @A Former User
                  last edited by A Former User

                  @Aaron-Studer said:

                  It just don't make since in my head to have a IP address resolve.... Only a domain. Maybe my head is the issue 😉

                  Why? Most do. http://216.58.217.142/

                  1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @A Former User
                    last edited by

                    @Aaron-Studer said:

                    It just don't make since in my head to have a IP address resolve.... Only a domain. Maybe my head is the issue 😉

                    It does make sense and that's why I've never heard of someone not wanting it to do this. It's the only logical thing for it to do. And remember, originally, this was the ONLY way we had websites. You are thinking of DNS as more ubiquitous than it should be.

                    1 Reply Last reply Reply Quote 1
                    • tonyshowoffT
                      tonyshowoff @A Former User
                      last edited by

                      @Aaron-Studer said:

                      It just don't make since in my head to have a IP address resolve.... Only a domain. Maybe my head is the issue 😉

                      You're only used to HTTP/1.1, but a long time ago in 1.0 it was something to consider, but now you don't have to worry about it. The only scenario is if someone manually does it, in which case you typically just want to return your main page anyway or 404, otherwise it will return the default virtual host if it exists. The way Apache works is, if no host is sent in the GET/POST/PUT/etc request then it will try to find the default virtual host (if virtual host module is enabled) and if that fails it will load whatever is in the default document path.

                      This is also for reverse compatibility with HTTP/1.0, and while pretty unlikely something will use that, it's such a simple configuration issue why not just support it?

                      1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller
                        last edited by

                        Or more importantly.... why put in extra effort to break it?

                        1 Reply Last reply Reply Quote 1
                        • ?
                          A Former User @scottalanmiller
                          last edited by A Former User

                          @scottalanmiller said:

                          There is nothing to know, really. You just tack the configuration on to the end of the httpd.conf file. Single file is the CentOS default. You need no guide, just edit the file.

                          So just copy the conf file on the end of httpd.conf, and delete the other conf file I created as part of the guide?

                          scottalanmillerS 1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User
                            last edited by A Former User

                            Looks like I should undo everything from steps 4 and 5 😞

                            Wish I knew this before I followed this guide... Bummer.

                            Might just fire up a fresh VM.... At least I am learning 🙂

                            My mistake for blindly following the guide without researching more....

                            1 Reply Last reply Reply Quote 0
                            • scottalanmillerS
                              scottalanmiller @A Former User
                              last edited by

                              @Aaron-Studer said:

                              @scottalanmiller said:

                              There is nothing to know, really. You just tack the configuration on to the end of the httpd.conf file. Single file is the CentOS default. You need no guide, just edit the file.

                              So just copy the conf file on the end of httpd.conf, and delete the other conf file I created as part of the guide?

                              Yes, that should be all that you need.

                              1 Reply Last reply Reply Quote 0
                              • ?
                                A Former User
                                last edited by

                                All fixed! Thanks everyone!!!

                                1 Reply Last reply Reply Quote 0
                                • 1
                                • 2
                                • 3
                                • 2 / 3
                                • First post
                                  Last post